Skip to content

Commit 16a7c83

Browse files
committed
refactor(ui): use false instead of null in dOrder
1 parent d25d315 commit 16a7c83

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/ui/src/components/_date-input/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export function deepCompareDate(a: Date | null | [Date, Date], b: Date | null |
3434
return false;
3535
}
3636

37-
export function orderDate(date: [Date, Date], order: 'ascend' | 'descend' | null, unit?: OpUnitType): boolean {
37+
export function orderDate(date: [Date, Date], order: 'ascend' | 'descend' | false, unit?: OpUnitType): boolean {
3838
if ((order === 'ascend' && dayjs(date[0]).isAfter(date[1], unit)) || (order === 'descend' && dayjs(date[0]).isBefore(date[1], unit))) {
3939
return true;
4040
}
4141
return false;
4242
}
4343

44-
export function orderTime(time: [Date, Date], order: 'ascend' | 'descend' | null): boolean {
44+
export function orderTime(time: [Date, Date], order: 'ascend' | 'descend' | false): boolean {
4545
const t1 = dayjs(time[0]).set('year', 2000).set('month', 0).set('date', 1);
4646
const t2 = dayjs(time[1]).set('year', 2000).set('month', 0).set('date', 1);
4747

packages/ui/src/components/date-picker/DatePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface DDatePickerProps extends Omit<React.HTMLAttributes<HTMLDivEleme
3030
dFormat?: string;
3131
dVisible?: boolean;
3232
dPlacement?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right';
33-
dOrder?: 'ascend' | 'descend' | null;
33+
dOrder?: 'ascend' | 'descend' | false;
3434
dPlaceholder?: string | [string?, string?];
3535
dRange?: boolean;
3636
dSize?: DSize;

packages/ui/src/components/time-picker/TimePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface DTimePickerProps extends Omit<React.HTMLAttributes<HTMLDivEleme
2929
dFormat?: string;
3030
dVisible?: boolean;
3131
dPlacement?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right';
32-
dOrder?: 'ascend' | 'descend' | null;
32+
dOrder?: 'ascend' | 'descend' | false;
3333
dPlaceholder?: string | [string?, string?];
3434
dRange?: boolean;
3535
dSize?: DSize;

0 commit comments

Comments
 (0)