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.
78 lines
1.4 KiB
JavaScript
78 lines
1.4 KiB
JavaScript
|
|
class AbstractSmartDatePart
|
|
{
|
|
constructor(placeholder, isStatic)
|
|
{
|
|
this._state = AbstractSmartDatePart.STATE_NONE;
|
|
this._cleanedValue = '';
|
|
this._parsedValue = '';
|
|
|
|
this._scanned = '';
|
|
this._placeholder = placeholder;
|
|
this._static = isStatic;
|
|
}
|
|
|
|
state()
|
|
{
|
|
return this._state;
|
|
}
|
|
|
|
isNoState()
|
|
{
|
|
return this._state === AbstractSmartDatePart.STATE_NONE;
|
|
}
|
|
|
|
isIncomplete()
|
|
{
|
|
return this._state === AbstractSmartDatePart.STATE_INCOMPLETE;
|
|
}
|
|
|
|
isComplete()
|
|
{
|
|
return this._state === AbstractSmartDatePart.STATE_COMPLETE;
|
|
}
|
|
|
|
resetState()
|
|
{
|
|
this._state = AbstractSmartDatePart.STATE_NONE;
|
|
}
|
|
|
|
cleanedValue()
|
|
{
|
|
return this._cleanedValue;
|
|
}
|
|
|
|
parsedValue()
|
|
{
|
|
return this._parsedValue;
|
|
}
|
|
|
|
placeHolder()
|
|
{
|
|
return this._placeholder;
|
|
}
|
|
|
|
isStatic()
|
|
{
|
|
return this._static;
|
|
}
|
|
|
|
_isNumericSymbol(symbol)
|
|
{
|
|
return '0' <= symbol && symbol <= '9';
|
|
}
|
|
|
|
/**
|
|
* @param {SmartDateCheckState} state
|
|
* @returns {Boolean}
|
|
*/
|
|
check(state)
|
|
{
|
|
return false;
|
|
}
|
|
};
|
|
|
|
AbstractSmartDatePart.STATE_NONE = 0;
|
|
AbstractSmartDatePart.STATE_INCOMPLETE = 1;
|
|
AbstractSmartDatePart.STATE_COMPLETE = 2;
|