A lightweight, powerful javascript datetime picker
95
{
"context": "This criteria evaluates how well the engineer uses flatpickr's setDate() method to programmatically update date picker values. The focus is on proper initialization of the flatpickr instance, correct usage of the setDate() API for programmatic date updates, and proper date calculations for the preset buttons.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Flatpickr initialization",
"description": "Properly initializes a flatpickr instance on the input element using the flatpickr() constructor or factory function",
"max_score": 15
},
{
"name": "Date format configuration",
"description": "Configures the flatpickr instance with the dateFormat option set to 'F j, Y' to display dates in the required format",
"max_score": 10
},
{
"name": "setDate() method usage",
"description": "Uses the setDate() method on the flatpickr instance to programmatically set dates when preset buttons are clicked",
"max_score": 30
},
{
"name": "Today preset calculation",
"description": "Correctly calculates today's date (current date) and passes it to setDate() when the Today button is clicked",
"max_score": 10
},
{
"name": "Tomorrow preset calculation",
"description": "Correctly calculates tomorrow's date (current date + 1 day) and passes it to setDate() when the Tomorrow button is clicked",
"max_score": 10
},
{
"name": "One Week preset",
"description": "Correctly calculates the date 7 days from today and passes it to setDate() when the One Week button is clicked",
"max_score": 10
},
{
"name": "One Month preset",
"description": "Correctly calculates the date 30 days from today and passes it to setDate() when the One Month button is clicked",
"max_score": 10
},
{
"name": "Button event handlers",
"description": "Properly attaches event listeners or handlers to all four preset buttons to trigger the date updates",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-flatpickrevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10