Skip to content

Commit

Permalink
Merge pull request pencilblue#492 from pencilblue/PB489
Browse files Browse the repository at this point in the history
pencilblue#489 fixed parsable date for negative time offset
  • Loading branch information
blakecallens committed Mar 11, 2015
2 parents a57c673 + 0cc1688 commit 19115cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/js/angular/filters/parsable_date.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ angular.module('parseDate', [])

var now = new Date();
var offset = Math.floor(now.getTimezoneOffset() / 60);
var offsetString = (offset < 10 ? '0' + offset : offset.toString()) + ':00';
if(offset < 0) {
offsetString = '+' + offsetString;
offset *= -1;
var offsetString = (offset < 10 ? '+0' + offset : '+' + offset) + ':00';
}
else {
offsetString = '-' + offsetString;
offsetString = (offset < 10 ? '-0' + offset : '-' + offset) + ':00';
}

return dateArray[2] + '-' + dateArray[0] + '-' + dateArray[1] + 'T' + dateArray[3] + ':' + dateArray[4] + offsetString;
Expand Down

0 comments on commit 19115cc

Please sign in to comment.