[Feature] support dates
See original GitHub issueThe general idea is to support the usage of date variables passed in as strings with some form of operator/type specifier to identify them as dates. The primary goal is to support comparison operators.
Example: {“<”:[{“date”: “2016-10-01T03:24:00.000Z”}, {“date”: “2016-10-15T03:24:00.000Z”}]}
Prototype:
"date" : function(a) {
return(new Date(a));
}
Example with var - works with date function in place: rule: {“<”:[{“date”:{“var”:“submitDate”}}, {“date”:{“var”: “dueDate”}}]} data: {“submitDate”:“2016-10-01T03:24:00.000Z”,“dueDate”:“2016-10-15T03:24:00.000Z”}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Windows 10 Enterprise and Education - Microsoft Lifecycle
Microsoft will continue to support at least one Windows 10 release until October 14, 2025. Support dates are shown in the Pacific Time...
Read more >Microsoft Windows - endoflife.date
Windows 11, version 22H2 (W), 3 months and 1 week ago. (20 Sep 2022). Ends in 1 year and 9 months. (14 Oct...
Read more >Windows 10 lifecycle details - Pureinfotech
On Windows 10, feature updates are released twice a year through the Semi-Annual Channel (SAC), governed by the new Modern Lifecycle Policy.
Read more >Reference Point: All Windows 10 Versions Release & EOL ...
What we do know is that Microsoft will be supporting Windows 10 until 14 October 2025, as per their lifecycle fact sheet, so...
Read more >IBM Software End of Support - Overview
End of support dates are generally effective on 30 April and 30 September. There are exceptions. Once a specific version or release reaches...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I still need to write some documentation, but I added the method
jsonLogic.add_operation
yesterday and I think it can solve this case. Here’s an example where string comparison does the wrong thing for two ISO 8601 dates (one Zulu time, the other Pacific time) and then using Date.parse to compare them correctly.And of course it works with
var
s too:And it’s user’s choice whether they want to use the built-in Date or they need something heavier duty like moment.js.
Does this do what you need it to?
That should work thanks!
On 28 October 2016 at 12:17, Jeremy Wadhams notifications@github.com wrote:
Rob Murtha 302-359-5943
http://www.linkedin.com/in/robmurtha http://www.twitter.com/robmurtha