When coercing a date string omitting the time part (e.g. YYYY-MM-DD), it was previously always parsed in local time. For example in the EST time zone, 2018-01-01 parsed to 2018-01-01:05:00:00.000Z.
This PR adds an optional utc mode to Joi.date() coercion. Usage:
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
When coercing a date string omitting the time part (e.g.
YYYY-MM-DD
), it was previously always parsed in local time. For example in the EST time zone,2018-01-01
parsed to2018-01-01:05:00:00.000Z
.This PR adds an optional utc mode to
Joi.date()
coercion. Usage:This parses to
2018-01-01:00:00:00.000Z
regardless of local time zone