We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Due to DST the hour change in my country (Cuba) from GMT -5 to GMT -4 last saturday (March 11) - sunday(March 12) https://www.timeanddate.com/time/dst/2017.html
But if I execute in Chrome Console the following commads the current week is not end at saturday as I expect it
Previous week is OK
moment().add(-1, 'week').startOf('week') Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Sun Mar 05 2017 00:00:00 GMT-0500 (CST)…} moment().add(-1, 'week').endOf('week') Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Sat Mar 11 2017 23:59:59 GMT-0500 (CST)…}
moment().startOf('week') Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Sun Mar 12 2017 01:00:00 GMT-0400 (CDT)…} moment().endOf('week') Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Sun Mar 19 2017 00:59:59 GMT-0400 (CDT)…}
Next Week (OK)
moment().add(1, 'week').startOf('week') Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Sun Mar 19 2017 00:00:00 GMT-0400 (CDT)…} moment().add(1, 'week').endOf('week') Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Sat Mar 25 2017 23:59:59 GMT-0400 (CDT)…}
the problem is just on this week the DST apply
Other information
console.log( (new Date()).toString()) Fri Mar 17 2017 19:35:32 GMT-0400 (CDT)
console.log((new Date()).toLocaleString()) 3/17/2017, 7:36:00 PM
console.log( (new Date()).getTimezoneOffset()) 240
console.log( navigator.userAgent) Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
console.log(moment.version) "2.17.1"
Regards Yo.
The text was updated successfully, but these errors were encountered:
Yeah, startOf and endOf are buggy with DSTs. Going to close this as a duplicate of #2749 because I suspect it's the same issue.
startOf
endOf
Sorry, something went wrong.
No branches or pull requests
Due to DST the hour change in my country (Cuba) from GMT -5 to GMT -4 last saturday (March 11) - sunday(March 12)
https://www.timeanddate.com/time/dst/2017.html
But if I execute in Chrome Console the following commads the current week is not end at saturday as I expect it
Previous week is OK
Current Week # (Problem!!)
Next Week (OK)
the problem is just on this week the DST apply
Other information
Regards
Yo.
The text was updated successfully, but these errors were encountered: