fix(core): use UTC date methods for slug formatting (#2944)

This commit is contained in:
Shawn Erquhart 2019-12-02 17:03:18 -05:00 committed by GitHub
parent 87b4d0f765
commit d0b32a7a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,12 +7,12 @@ function formatDate(date) {
}
export const dateParsers = {
year: date => date.getFullYear(),
month: date => formatDate(date.getMonth() + 1),
day: date => formatDate(date.getDate()),
hour: date => formatDate(date.getHours()),
minute: date => formatDate(date.getMinutes()),
second: date => formatDate(date.getSeconds()),
year: date => date.getUTCFullYear(),
month: date => formatDate(date.getUTCMonth() + 1),
day: date => formatDate(date.getUTCDate()),
hour: date => formatDate(date.getUTCHours()),
minute: date => formatDate(date.getUTCMinutes()),
second: date => formatDate(date.getUTCSeconds()),
};
export const SLUG_MISSING_REQUIRED_DATE = 'SLUG_MISSING_REQUIRED_DATE';