A lightweight, powerful javascript datetime picker
95
A utility that manages a date picker instance with dynamically adjustable configuration based on user preferences and form context.
@generates
/**
* Creates and manages a date picker instance with dynamic configuration capabilities.
*
* @param {HTMLInputElement} inputElement - The input element to attach the date picker to
* @returns {Object} A manager object with methods to control the date picker
*/
function createDatePickerManager(inputElement) {
// Returns an object with the following methods:
return {
/**
* Gets the current date picker instance
* @returns {Object} The flatpickr instance
*/
getInstance: function() {},
/**
* Updates the date format
* @param {string} format - The new date format string (e.g., "Y-m-d", "F j, Y", "m/d/Y")
*/
setDateFormat: function(format) {},
/**
* Toggles week numbers display
* @param {boolean} enabled - Whether to show week numbers
*/
toggleWeekNumbers: function(enabled) {},
/**
* Toggles time picker
* @param {boolean} enabled - Whether to enable time selection
*/
toggleTimePicker: function(enabled) {},
/**
* Sets minimum selectable date
* @param {Date|string|null} minDate - The minimum date, or null to remove constraint
*/
setMinDate: function(minDate) {},
/**
* Sets maximum selectable date
* @param {Date|string|null} maxDate - The maximum date, or null to remove constraint
*/
setMaxDate: function(maxDate) {},
/**
* Sets both minimum and maximum dates
* @param {Date|string|null} minDate - The minimum date
* @param {Date|string|null} maxDate - The maximum date
*/
setDateRange: function(minDate, maxDate) {}
};
}
module.exports = { createDatePickerManager };Provides datetime picker functionality with dynamic configuration support.
@satisfied-by
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