A lightweight, powerful javascript datetime picker
95
{
"context": "This criteria evaluates how effectively the engineer uses flatpickr's onChange event hook to capture and respond to date selection events. The focus is on proper initialization of flatpickr with the onChange callback and correct handling of the callback parameters.",
"type": "weighted_checklist",
"checklist": [
{
"name": "flatpickr initialization",
"description": "Properly initializes flatpickr on the input element by calling flatpickr() constructor with the element and configuration object",
"max_score": 15
},
{
"name": "onChange hook implementation",
"description": "Implements the onChange callback function in the flatpickr configuration object to capture date selection events",
"max_score": 30
},
{
"name": "onChange parameters usage",
"description": "Correctly uses the onChange callback parameters (selectedDates array, dateStr string, and instance object) to access the selected date information",
"max_score": 25
},
{
"name": "Date formatting",
"description": "Properly formats the date from the onChange callback into YYYY-MM-DD format, using either the dateStr parameter or formatting the Date object from selectedDates array",
"max_score": 15
},
{
"name": "Clear functionality integration",
"description": "Uses flatpickr's clear() method or setDate() method to programmatically clear the selection when the clear button is clicked",
"max_score": 10
},
{
"name": "Real-time event handling",
"description": "Ensures the onChange callback executes immediately upon date selection, properly updating the log display without requiring additional user actions",
"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