Skip to content

Commit

Permalink
Moves WeekDay type to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
scottlovegrove committed Jul 3, 2023
1 parent 4170e9a commit 6794d53
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/Schedulely/src/types/DateAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { WeekDay } from './WeekDay';

/**
* Common interface for porting date libraries so they can be used with Schedulely
*/
Expand Down Expand Up @@ -51,14 +53,3 @@ export interface DateTimeAdapter {
/** What day of the week the week starts on, with 0 = Sunday, 1 = Monday, etc. */
weekStartsOn: WeekDay;
}

export const WeekDayNames = [
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday',
] as const;
export type WeekDay = (typeof WeekDayNames)[number];
10 changes: 10 additions & 0 deletions packages/Schedulely/src/types/WeekDay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const WeekDayNames = [
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday',
] as const;
export type WeekDay = (typeof WeekDayNames)[number];
2 changes: 2 additions & 0 deletions packages/Schedulely/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export * from './InternalCalendarEvent';
export * from './InternalEventWeek';
export * from './SchedulelyComponents';
export * from './SchedulelyProps';
export * from './WeekDay';
export * from './components/index';
export * from './state/index';
export * from './WeekDay';

0 comments on commit 6794d53

Please sign in to comment.