Skip to content

Commit

Permalink
fix(date-input): made number valid model value type
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed Nov 29, 2023
1 parent 8b934fb commit 542ab0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default {
dayView: { type: 'day', month: 3, year: 2013 } as DatePickerView,
string: getStaticDate().toString(),
strings: [getStaticDate().getTime() + 1e9, getStaticDate().toString()] as DateInputModelValue,
stringRange: { start: getStaticDate().toString(), end: getStaticDate().getTime() + 1e9 } as unknown as DateInputModelValue,
stringRange: { start: getStaticDate().toString(), end: getStaticDate().getTime() + 1e9 } as DateInputModelValue,
validationRules1: [(value: Date) => {
return !!value || 'Should be value'
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-date-input/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type DateInputDate = string | Date
export type DateInputDate = string | number | Date
export type DateInputRange<T> = { start?: T | null, end?: T | null }
export type DateInputValue = Date | Date[] | DateInputRange<Date>
export type DateInputModelValue = DateInputDate | DateInputDate[] | DateInputRange<DateInputDate> | undefined | null

0 comments on commit 542ab0c

Please sign in to comment.