-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
app/index.html
Outdated
@@ -27,9 +27,14 @@ | |||
<script src="/js/lib/chosen-angular.js"></script> | |||
<script src="//cdn.tinymce.com/4/tinymce.min.js"></script> | |||
<script src="/js/lib/angular-ui-tinymce.js"></script> | |||
|
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.11/moment-timezone.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should moment-timezone
be part of user-defined libraries, since you're including it in app/js/lib/moment-timezone.min.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, would https://github.com/urish/angular-moment
be more suitable?
@@ -22,6 +22,8 @@ angular | |||
} | |||
|
|||
_.each($scope.data, element => { | |||
element = preProcess.changeDate(element); | |||
element.attributes.recievedOn = preProcess.convertTimeToEST(element.attributes.recievedOn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this necessary / not covered in preProcess.changeDate(element)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changeDate() is a helper function that called convertTimeToEST() except it only calls it on the element's create and modified attributes. Since some pages have other fields that require the conversion, you can use convertTimeToEST() on them in their controller.
app/js/services/preprocessing.js
Outdated
hour -= 12; | ||
night = 'PM'; | ||
} | ||
//return this.prettifyDate(time) + " " + hour + ":" + minute + night; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment!
app/js/services/preprocessing.js
Outdated
night = 'PM'; | ||
} | ||
//return this.prettifyDate(time) + " " + hour + ":" + minute + night; | ||
return moment(time).tz('America/New_York').format('LLLL');; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do October 1, 2014 12:00 AM (Wednesday)
instead of Wednesday, October 1, 2014 12:00 AM
?
Sure, go ahead! |
@@ -22,7 +22,7 @@ angular | |||
$scope.model = _.find($scope.data, {id: resourceId}); | |||
} | |||
_.each($scope.data, function(element) { | |||
element = preProcess.changeDate(element); | |||
element = preProcess.convertTimeAtrtributes(element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling -> Attributes
app/js/services/preprocessing.js
Outdated
.then(function(list){ | ||
list.forEach(function(element) { | ||
objectIdToNameHash[element.id] = element.attributes.name; | ||
.then(function(element){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you keep it the way it was before for line 18 to 20?
@@ -22,6 +22,7 @@ angular | |||
} | |||
|
|||
_.each($scope.data, element => { | |||
element = preProcess.convertTimeAtrtributes(element, Array("recievedOn")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you are using ...attributeArray
, "recievedOn" doesn't need to be in an array. u could do element = preProcess.convertTimeAttributes(element, "recievedOn")
, unless you want to change the signature of the function
app/js/services/preprocessing.js
Outdated
var day = parseInt(date.substring(8, 10)); | ||
return monthNames[month - 1] + " " + day + ", "+ year; | ||
}, | ||
convertTimeAtrtributes: function(element, ...attributeArray){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rmb to update spelling for all of the places u r using convertTimeAtrtributes
-> convertTimeAttributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢💯🚀
For Issue #170
Question: preProcess.prettifyDate() can be replaced with moment functions. Should I refactored that?