date input: use distinct 'null' value state if unset by user
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
interface Props {
|
||||
name?: string;
|
||||
value?: CalendarDate;
|
||||
value?: CalendarDate | null;
|
||||
min?: CalendarDate;
|
||||
// max?: CalendarDate; // TODO: Implement validation.
|
||||
label?: string;
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
let {
|
||||
name,
|
||||
value = $bindable<CalendarDate | undefined>(),
|
||||
value = $bindable<CalendarDate | null>(null),
|
||||
/** min specifies lower bounds for the date input (WARNING: NOT IMPLEMENTED) */
|
||||
min = new CalendarDate(1900, 0, 1),
|
||||
/** max specifies upper bounds for the date input (WARNING: NOT IMPLEMENTED) */
|
||||
@@ -108,7 +108,7 @@
|
||||
if (value) {
|
||||
setPrevious();
|
||||
previousYearValue = undefined;
|
||||
value = undefined;
|
||||
value = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -121,7 +121,7 @@
|
||||
if (value) {
|
||||
setPrevious();
|
||||
previousMonthValue = undefined;
|
||||
value = undefined;
|
||||
value = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -134,7 +134,7 @@
|
||||
if (value) {
|
||||
setPrevious();
|
||||
previousDayValue = undefined;
|
||||
value = undefined;
|
||||
value = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user