Skip to content

Commit

Permalink
rev sugar
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McFadden committed Nov 22, 2024
1 parent 44c0294 commit 7b8720f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions assets/js/dateWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ function modifyRange(event) {

}

Sugar.extend();

function parseDateString(dateString, event) {
if(dateString.length > 0) {
if(Date.create(dateString).isValid()) {
var dateNumeric = Date.utc.create(dateString).getTime()/1000;
var dateNumeric = Date.create(dateString, {fromUTC: true}).getTime()/1000;
if(event) {
$(event.target).siblings('.dateHidden').val(dateNumeric);
}

return true;
}
else {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ function prepTimeline() {
else {
t = new Date(1970,0,1);
t.setSeconds(startTime);
formattedStart = Date.utc.create(t);
formattedStart = Date.create(t, {fromUTC: true});
newItem.start_date.display_date = date.start["text"];
newItem.start_date.year = formattedStart.getFullYear();
newItem.start_date.month = formattedStart.getMonth() + 1;
Expand All @@ -693,7 +693,7 @@ function prepTimeline() {
else {
t = new Date(1970,0,1);
t.setSeconds(endTime);
formattedEnd = Date.utc.create(t);
formattedEnd = Date.create(t, {fromUTC: true});
newItem.end_date.display_date = date.end["text"];
newItem.end_date.year = formattedEnd.getFullYear();
newItem.end_date.month = formattedEnd.getMonth() + 1;
Expand Down

0 comments on commit 7b8720f

Please sign in to comment.