You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
698 B
JavaScript

class SmartDateStaticPart extends AbstractSmartDatePart
{
constructor(placeholder)
{
super(placeholder, true);
this._cleanedValue = placeholder;
}
/**
* @param {SmartDateCheckState} state
* @returns {Boolean}
*/
parse(state)
{
let value = state.value();
let index = state.valueIndex();
while (index < value.length && !this._isNumericSymbol(value[index])) {
index++;
}
this._parsedValue = value.substring(state.valueIndex(), index);
this._state = AbstractSmartDatePart.STATE_COMPLETE;
state.setValueIndex(index);
return true;
}
}