Created
September 18, 2024 12:25
-
-
Save VerosK/c0ab8d06d57b9ae0b51256f7baaa4f19 to your computer and use it in GitHub Desktop.
Test later.js parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var later = require('later'); | |
var schedule = later.parse.text('on sunday every 2nd week'); | |
//var dateToCheck = new Date('2024-01-21T10:10:00Z'); | |
var dateToCheck = new Date('2024-02-04T10:10:00Z'); | |
//console.log(schedule); | |
// Check if the date is valid in the schedule | |
var isValid = later.schedule(schedule).isValid(dateToCheck); | |
console.log('Is the date in the schedule?', isValid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment