Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 '.';
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.Monday,
yearRange: (): [number, number] => [1900, 2100],
ui: () => ({}),
locale: () => enUS,
Expand Down
10 changes: 10 additions & 0 deletions src/VueDatePicker/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,13 @@ export enum MAP_KEY_FORMAT {
YEAR = 'yyyy',
DATE = 'dd-MM-yyyy',
}

export enum WeekStart {
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
}
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 '@/constants';

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
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as VueDatePicker } from './VueDatePicker/VueDatePickerRoot.vue';
export { TZDate } from '@date-fns/tz';
export * from './VueDatePicker/types';
export { WeekStart } from './VueDatePicker/constants';
Loading