Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,7 @@ typings/
.tern-port

docs/.vitepress/cache
docs/.vitepress/dist
docs/.vitepress/dist

# ignore .DS_Store files
.DS_Store
3 changes: 2 additions & 1 deletion src/VueDatePicker/constants/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { WeekStart } from '@/types';
import { enUS } from 'date-fns/locale';

export const defaultRangeOptions = {
Expand Down Expand Up @@ -148,7 +149,7 @@ export const basePropDefaults = {
};

export const propDefaults = {
weekStart: 1,
weekStart: WeekStart.Sunday,
yearRange: (): [number, number] => [1900, 2100],
ui: () => ({}),
locale: () => enUS,
Expand Down
9 changes: 9 additions & 0 deletions src/VueDatePicker/types/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export enum WeekStart {
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
}
1 change: 1 addition & 0 deletions src/VueDatePicker/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './configs.ts';
export * from './generic.ts';
export * from './picker.ts';
export * from './emits.ts';
export * from './enums.ts';
3 changes: 2 additions & 1 deletion src/VueDatePicker/types/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
import type { CalendarWeek, Marker, TimeModel, PresetDate, HighlightFn, DisabledTimesFn } from '@/types/picker.ts';
import type { PickerSection, DateValue, ModelValue, SixWeekMode } from '@/types/generic.ts';
import { basePropDefaults, type propDefaults } from '@/constants/defaults.ts';
import type { WeekStart } from '@/types/enums.ts';

export interface RootProps {
multiCalendars?: boolean | number | string | Partial<MultiCalendarsConfig>;
Expand Down Expand Up @@ -53,7 +54,7 @@ export interface RootProps {
teleport?: string | boolean | HTMLElement;
centered?: boolean;
locale?: Locale;
weekStart?: string | number;
weekStart?: string | number | WeekStart;
weekNumbers?: boolean | WeekNumbersConfig;
dayNames?: (() => string[]) | string[];
monthPicker?: boolean;
Expand Down