Moment's UTC-mode .weekday() incorrect
HTML
<script src="https://rawgithub.com/moment/moment/2.2.1/moment.js"></script>
JavaScript
moment.lang('en');
// The language is US-English, so the first day of the week is `0`
// (a Sunday)
console.log(
"lang's first day of week:",
moment().lang()._week.dow
);
// We will test with the UTC date 2013-09-15,
// which is a *Sunday*
// The .weekday() *should* be `0`.
// However, if your browser's timezone offset is negative
// like me (I'm in San Francisco),
// then this will incorrectly appear as `6`.
console.log(
"first minute's weekday:",
moment('2013-09-15T00:00:00Z').utc().weekday()
);
// The .weekday() *should* be `0`
// However, if your browser's timezone offset is positive.
// then this value will incorrectly appear as `1`.
console.log(
"last minute's weekday:",
moment('2013-09-15T23:59:00Z').utc().weekday()
);
console.log(
"Time Zone:",
moment('2013-09-15T23:59:00Z').getTimezone()
);