Skip to content

Cast milisecond strings to a date object#357

Merged
hueniverse merged 1 commit intohapijs:masterfrom
dignifiedquire:cast_date
Jun 13, 2014
Merged

Cast milisecond strings to a date object#357
hueniverse merged 1 commit intohapijs:masterfrom
dignifiedquire:cast_date

Conversation

@dignifiedquire
Copy link
Contributor

Some clients pass all values as strings, which leads to problems when trying to validate dates based on milliseconds, as they need to be cast to a number before Joi.date() accepts them as valid dates.

This PR adds the ability to automatically cast values like "1401919200000" to the correct Date object.

@hueniverse hueniverse added the bug label Jun 13, 2014
@hueniverse hueniverse added this to the 4.6.1 milestone Jun 13, 2014
@hueniverse hueniverse self-assigned this Jun 13, 2014
hueniverse pushed a commit that referenced this pull request Jun 13, 2014
Cast milisecond strings to a date object
@hueniverse hueniverse merged commit 06ea690 into hapijs:master Jun 13, 2014
hueniverse pushed a commit that referenced this pull request Jun 13, 2014
hueniverse pushed a commit that referenced this pull request Jun 14, 2014
@lock
Copy link

lock bot commented Jan 9, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants