Skip to content

Commit

Permalink
docs(Types): updated Locale type examples and included default
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Jul 19, 2023
1 parent ef6f4a4 commit 3c410a6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/types/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<CodeBlock language="typescript" code={carouselSlide} />

<h2 id="DatePickerActions" class="text-content mb-0">DatePickerAction</h2>
<h2 id="DatePickerActions" class="text-content mb-0 mt-12">DatePickerAction</h2>

<p class="mb-5 mt-1 text-secondary-content">
Used in conjunction with the <a class="link" href="/datepicker">DatePicker</a> components.
Expand Down
27 changes: 27 additions & 0 deletions src/routes/types/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ export const locale = `type Locale = {
weekdays?: string[];
months?: string[];
weekStartsOn?: number;
}
const localDefault = {
weekdays: [
dayjs().day(0).format('dd'), // Sunday
dayjs().day(1).format('dd'), // Monday
dayjs().day(2).format('dd'), // Tuesday
dayjs().day(3).format('dd'), // Wednesday
dayjs().day(4).format('dd'), // Thursday
dayjs().day(5).format('dd'), // Friday
dayjs().day(6).format('dd') // Saturday
],
months: [
dayjs().month(0).format('MMMM'), // January
dayjs().month(1).format('MMMM'), // February
dayjs().month(2).format('MMMM'), // March
dayjs().month(3).format('MMMM'), // April
dayjs().month(4).format('MMMM'), // May
dayjs().month(5).format('MMMM'), // June
dayjs().month(6).format('MMMM'), // July
dayjs().month(7).format('MMMM'), // August
dayjs().month(8).format('MMMM'), // September
dayjs().month(9).format('MMMM'), // October
dayjs().month(10).format('MMMM'), // November
dayjs().month(11).format('MMMM') // December
],
weekStartsOn: 0
};`;

export const lightboxAction = `interface LightboxAction {
Expand Down

0 comments on commit 3c410a6

Please sign in to comment.