-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Given a data object like
{
id: 1234567,
importantDateValue: '12-12-2022'
}
and given a criteria value like
"isNewerThanImportantDate": {
"criteria": [
{
"has": {
"trait": "importantDateValue",
"comparison": "younger",
"value": "12-01-2022"
}
}
]
}
Expected result should be true
since the human-readable dates are different and since the data object date of December 12 is newer than the comparison date of December 1.
Note:
new Date('12-12-2022') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
new Date('12-Dec-2022') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
new Date('12/12/2022') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
new Date('12.12.22') ==> Mon Dec 12 2022 00:00:00 GMT-0800 (Pacific Standard Time)
Date comparison strings could be try'd before comparison. Since younger
and older
are limited to Date access, some pre-validation could be implemented.
Metadata
Metadata
Assignees
Labels
No labels