Skip to content

Commit

Permalink
Use moment.utc for date time utils to make them predictable.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuspahl committed Oct 18, 2023
1 parent 3a0f61e commit 33b73a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graylog2-web-interface/src/util/DateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const getFormatStringsForDateTimeFormats = (dateTimeFormats: Array<DateTimeForma

export const toDateObject = (dateTime: DateTime, acceptedFormats?: Array<DateTimeFormats>, tz = DEFAULT_OUTPUT_TZ) => {
const acceptedFormatStrings = getFormatStringsForDateTimeFormats(acceptedFormats);
const dateObject = moment(dateTime, acceptedFormatStrings, true).tz(tz);
const dateObject = moment.utc(dateTime, acceptedFormatStrings, true).tz(tz);
const validationInfo = acceptedFormats?.length ? `Expected formats: ${acceptedFormatStrings.join(', ')}.` : undefined;

return validateDateTime(dateObject, dateTime, validationInfo);
Expand Down

0 comments on commit 33b73a5

Please sign in to comment.