add: comments

This commit is contained in:
Chen Lily 2024-03-27 10:09:25 +08:00
parent 6458427c75
commit c78e445a24

View File

@ -145,7 +145,33 @@ export function getDateValue(element, formatter) {
*/
export class DateSelector {
_var = {
options: null
/**
* @type {HTMLInputElement}
* @private
*/
el: null,
options: {
/**
* @type {boolean?}
* @private
*/
enabled: true,
/**
* @type {string?}
* @private
*/
minDate: null,
/**
* @type {string?}
* @private
*/
maxDate: null,
/**
* @type {DateFormatterCallback?}
* @private
*/
valueFormatter: null
}
};
/**
@ -256,6 +282,11 @@ export class DateSelector {
this._var.options.maxDate = date;
}
/**
* @private
* @param {Date} date
* @returns {Date | any}
*/
_getDate(date) {
if (date instanceof Date && !isNaN(date)) {
const year = date.getUTCFullYear();