diff --git a/README.md b/README.md index 7363683..267464d 100644 --- a/README.md +++ b/README.md @@ -234,8 +234,8 @@ export class HomePage { | weekStart | number | `0` | set week start day `0` of sundaty, `1` of monday | IDayConfig | Array<**_IDayConfig_**> | `[]` | days configuration | displayMode | string | `month` | 'month', 'week' -| showAdjacentMonthDay | boolean | `true` | show days of other months if `displayMode:month` -| showMonthSubtitle | boolean | `false` | show the month in the subtitle if `displayMode:week` +| showAdjacentMonthDay | boolean | `true` | show days of adjacent months when `displayMode: 'month'` +| showMonthAdjacentDays | boolean | `false` | show the month on days adjacent to the selected month when `displayMode: 'week'` | weeks | number | `1` | number of week to show in week display mode | locale | ICalendarLocale | {locale: 'en', weekdays: 'initial' } | change calendar locale and set default name to weeks diff --git a/projects/demo/src/app/demos/demo-basic/demo-basic.component.ts b/projects/demo/src/app/demos/demo-basic/demo-basic.component.ts index d9e9520..3aaff95 100644 --- a/projects/demo/src/app/demos/demo-basic/demo-basic.component.ts +++ b/projects/demo/src/app/demos/demo-basic/demo-basic.component.ts @@ -228,10 +228,10 @@ export class DemoBasicComponent { } - onChangeWeekStart(weekStart: string) { + onChangeWeekStart(weekStart: 0 | 1) { this.options = { ...this.options, - weekStart: parseInt(weekStart, 10), + weekStart: weekStart, }; } @@ -251,13 +251,6 @@ export class DemoBasicComponent { } } - onChangeContinuous(continuous: boolean) { - this.options = { - ...this.options, - continuous - }; - } - onChangeShowAdjacentMonthDay(showAdjacentMonthDay: boolean) { this.options = { ...this.options, @@ -265,10 +258,10 @@ export class DemoBasicComponent { }; } - onChangeShowMonthSubtitle(showMonthSubtitle: boolean) { + onChangeShowMonthAdjacentDays(showMonthAdjacentDays: boolean) { this.options = { ...this.options, - showMonthSubtitle + showMonthAdjacentDays }; } diff --git a/projects/demo/src/app/demos/demo-modal-locale/demo-modal-locale.component.ts b/projects/demo/src/app/demos/demo-modal-locale/demo-modal-locale.component.ts index 3effc10..a03f980 100644 --- a/projects/demo/src/app/demos/demo-modal-locale/demo-modal-locale.component.ts +++ b/projects/demo/src/app/demos/demo-modal-locale/demo-modal-locale.component.ts @@ -1,6 +1,5 @@ import { Component } from '@angular/core'; import { ModalController } from '@ionic/angular'; -import * as luxon from 'luxon'; import { CalendarModalComponent, ICalendarModalOptions } from '@heliomarpm/ion-calendar'; diff --git a/projects/ion-calendar/README.md b/projects/ion-calendar/README.md index 2b465a4..267464d 100644 --- a/projects/ion-calendar/README.md +++ b/projects/ion-calendar/README.md @@ -91,7 +91,7 @@ import { IonCalendarModule } from '@heliomarpm/ion-calendar'; imports: [ ..., IonicModule.forRoot(), - // See IICalendarComponentOptions for options + // See ICalendarComponentOptions for options IonCalendarModule.forRoot({ doneLabel: 'Confirm', closeIcon: true @@ -219,7 +219,8 @@ export class HomePage { | - | - | - | - | from | Date | `new Date()` | start date | to | Date | 0 (Infinite) | end date -| color | string | `'primary'` | 'primary', 'secondary', 'danger', 'light', 'dark' +| color | string | `'primary'` | 'primary', 'secondary','tertiary', 'success', 'warning', 'danger', 'dark', 'medium', 'light', 'custom', 'transparent' +| colorSubtitle | string | `undefined` | 'primary', 'secondary','tertiary', 'success', 'warning', 'danger', 'dark', 'medium', 'light', 'custom', 'transparent' | pickMode | string | `single` | 'multi', 'range', 'single' | showToggleButtons | boolean | `true` | show toggle buttons | monthsTitle | Array | `['JAN', 'FEB', ..., 'NOV', 'DEC']` | month picker format @@ -232,8 +233,9 @@ export class HomePage { | weekdays | Array | `['S', 'M', 'T', 'W', 'T', 'F', 'S']` | weeks text | weekStart | number | `0` | set week start day `0` of sundaty, `1` of monday | IDayConfig | Array<**_IDayConfig_**> | `[]` | days configuration -| showAdjacentMonthDay | boolean | `true` | show days of other months | displayMode | string | `month` | 'month', 'week' +| showAdjacentMonthDay | boolean | `true` | show days of adjacent months when `displayMode: 'month'` +| showMonthAdjacentDays | boolean | `false` | show the month on days adjacent to the selected month when `displayMode: 'week'` | weeks | number | `1` | number of week to show in week display mode | locale | ICalendarLocale | {locale: 'en', weekdays: 'initial' } | change calendar locale and set default name to weeks diff --git a/projects/ion-calendar/src/lib/components/calendar-modal/calendar-modal.component.ts b/projects/ion-calendar/src/lib/components/calendar-modal/calendar-modal.component.ts index 6df1665..528166d 100644 --- a/projects/ion-calendar/src/lib/components/calendar-modal/calendar-modal.component.ts +++ b/projects/ion-calendar/src/lib/components/calendar-modal/calendar-modal.component.ts @@ -1,13 +1,5 @@ import { - Component, - ViewChild, - ElementRef, - ChangeDetectorRef, - Renderer2, - OnInit, - Input, - AfterViewInit, - HostBinding, + Component, ViewChild, ElementRef, ChangeDetectorRef, Renderer2, OnInit, Input, AfterViewInit } from '@angular/core'; import { NavParams, ModalController, IonContent } from '@ionic/angular'; @@ -54,7 +46,7 @@ export class CalendarModalComponent implements OnInit, AfterViewInit { public calSvc: IonCalendarService ) { // console.log("CalendarModalComponent.constructor"); - } + } ngOnInit(): void { this.init(); diff --git a/projects/ion-calendar/src/lib/components/calendar-month/calendar-month.component.scss b/projects/ion-calendar/src/lib/components/calendar-month/calendar-month.component.scss index 92f3e47..4ba4b76 100644 --- a/projects/ion-calendar/src/lib/components/calendar-month/calendar-month.component.scss +++ b/projects/ion-calendar/src/lib/components/calendar-month/calendar-month.component.scss @@ -17,11 +17,16 @@ ion-note { .last-month-day, .next-month-day { + color: var(--color, #000); + + &[disabled] p { + opacity: .165; + } + p { - // color: rgba(0, 0, 0, 0.25); - color: var(--color, #000); - opacity: 0.3; + opacity: .35; } + } .today p { @@ -191,7 +196,7 @@ ion-note { &[disabled] p { // color: rgba(0, 0, 0, 0.3); color: var(--color, #000); - opacity: 0.3; + opacity: 0.165; } &.on-selected ion-note { diff --git a/projects/ion-calendar/src/lib/components/calendar-week/calendar-week.component.ts b/projects/ion-calendar/src/lib/components/calendar-week/calendar-week.component.ts index 5f0ed3d..2b9607b 100644 --- a/projects/ion-calendar/src/lib/components/calendar-week/calendar-week.component.ts +++ b/projects/ion-calendar/src/lib/components/calendar-week/calendar-week.component.ts @@ -36,19 +36,17 @@ export class CalendarWeekComponent { } private adjustSort(weekStart: number): void { - if (weekStart === this._weekStart && this.isEquals(this._weekDays, this._weekDaysOld)) return; + if (weekStart == this._weekStart && this.isEquals(this._weekDays, this._weekDaysOld)) return; - if (weekStart === 1) { + if (weekStart == 1) { const cacheWeekArray = [...this._weekDays]; cacheWeekArray.push(cacheWeekArray.shift()!); this.displayWeekDays = [...cacheWeekArray]; - } else if (weekStart === 0) { + } else { this.displayWeekDays = [...this._weekDays]; } - else { - return; - } + this._weekDaysOld = Array.from(this._weekDays); this._weekStart = weekStart; } diff --git a/projects/ion-calendar/src/lib/components/calendar/calendar.component.ts b/projects/ion-calendar/src/lib/components/calendar/calendar.component.ts index ffe3495..c6fbcb5 100644 --- a/projects/ion-calendar/src/lib/components/calendar/calendar.component.ts +++ b/projects/ion-calendar/src/lib/components/calendar/calendar.component.ts @@ -196,11 +196,6 @@ export class CalendarComponent implements ControlValueAccessor, OnInit { let newWeek = this.calSvc.multiFormat(nextTime); const oldWeek = this.calSvc.multiFormat(this.monthOpt.original.time); - if (oldWeek.month != newWeek.month && !this.def.continuous) { - nextTime = DateTime.fromMillis(nextTime).set({ day: 1 }).valueOf(); - newWeek = this.calSvc.multiFormat(nextTime); - } - this.monthOpt = this.createWeek(nextTime); this.onWeekChange.emit({ oldWeek: oldWeek, newWeek: this.calSvc.multiFormat(this.monthOpt.original.time), }); @@ -214,7 +209,7 @@ export class CalendarComponent implements ControlValueAccessor, OnInit { if (!this.def.to || this.view !== 'days') return true; const toDate = DateTimeHelper.parse(this.def.to); - return this.monthOpt.original.lastDay < toDate.toMillis(); + return this.monthOpt.original.lastDayOfMonth < toDate.toMillis(); } private backMonth(): void { @@ -231,26 +226,6 @@ export class CalendarComponent implements ControlValueAccessor, OnInit { let newWeek = this.calSvc.multiFormat(backTime); const oldWeek = this.calSvc.multiFormat(this.monthOpt.original.time); - if (oldWeek.month != newWeek.month && !this.def.continuous) { - const start = new Date(this.monthOpt.original.time); - let dayToSubstrac = start.getDay(); - if (this.options.weekStart === 1) { - dayToSubstrac--; - if (dayToSubstrac < 0) { - dayToSubstrac = 6; - } - } - - const firstDayMonth = new Date(start.getFullYear(), start.getMonth(), 1).getTime(); - let momentBackTime = DateTime.fromMillis(firstDayMonth); - if (start.getDate() - dayToSubstrac <= 1) { - momentBackTime = momentBackTime.minus({ days: 1 }); - } - backTime = momentBackTime.valueOf(); - - newWeek = this.calSvc.multiFormat(backTime); - } - this.onWeekChange.emit({ oldWeek: oldWeek, newWeek: newWeek, }); if (oldWeek.month != newWeek.month) { @@ -449,7 +424,7 @@ export class CalendarComponent implements ControlValueAccessor, OnInit { } } - writeValue(obj: any): void { + writeValue(obj: CalendarComponentOnChangeType): void { this._writeValue(obj); if (obj) { if (this.calendarMonthValue[0]) { @@ -463,11 +438,11 @@ export class CalendarComponent implements ControlValueAccessor, OnInit { } } - registerOnChange(fn: () => {}): void { + registerOnChange(fn: Function): void { this._onChanged = fn; } - registerOnTouched(fn: () => {}): void { + registerOnTouched(fn: Function): void { this._onTouched = fn; } diff --git a/projects/ion-calendar/src/lib/ion-calendar.service.ts b/projects/ion-calendar/src/lib/ion-calendar.service.ts index b73966d..39b78c5 100644 --- a/projects/ion-calendar/src/lib/ion-calendar.service.ts +++ b/projects/ion-calendar/src/lib/ion-calendar.service.ts @@ -6,8 +6,6 @@ import { DEFAULT_CALENDAR_OPTIONS } from './calendar-options.provider'; import { DateTime } from 'luxon'; -const isBoolean = (input: any) => input === true || input === false; - @Injectable({ providedIn: 'root' }) @@ -56,7 +54,7 @@ export class IonCalendarService { clearLabel = null, displayMode = defaultValues.DISPLAY_MODE, showAdjacentMonthDay = true, - showMonthSubtitle = false, + showMonthAdjacentDays = false, weeks = 1 } = { ...this.defaultOpts, ...calendarOptions }; @@ -94,10 +92,9 @@ export class IonCalendarService { defaultDateRange: calendarOptions.defaultDateRange || null, clearLabel, showAdjacentMonthDay, - showMonthSubtitle, + showMonthAdjacentDays, displayMode, - weeks, - continuous: true + weeks }; } @@ -109,22 +106,22 @@ export class IonCalendarService { const firstWeek = new Date(year, month, 1).getDay(); // const howManyDays = moment(time).daysInMonth(); - const howManyDays = luxon.daysInMonth!; - const lastDay = luxon.endOf("day").valueOf(); + const daysInMonth: number = luxon.daysInMonth!; + const lastDayOfMonth = luxon.endOf("month").valueOf(); return { date, year, month, firstWeekDay: firstWeek, - howManyDays, + daysInMonth, time: new Date(year, month, (timeWithDay) ? date.getDate() : 1).getTime(), - lastDay + lastDayOfMonth }; } - private findDayConfig(day: DateTime, opt: ICalendarModalOptions): IDayConfig | null { - const { daysConfig } = opt; + private findDayConfig(day: DateTime, options: ICalendarModalOptions): IDayConfig | null { + const { daysConfig } = options; const dayConfig = daysConfig?.find((config) => { const dateTime = DateTimeHelper.parse(config.date) @@ -138,55 +135,46 @@ export class IonCalendarService { * Create a calendar day object based on the given time, options, and month. * * @param {number} time - The time in milliseconds. - * @param {ICalendarModalOptions} opt - The calendar modal options. + * @param {ICalendarModalOptions} options - The calendar modal options. * @param {number} month - The month number. * @return {ICalendarDay} The created calendar day object. */ - createCalendarDay(time: number, opt: ICalendarModalOptions, month?: number): ICalendarDay { + createCalendarDay(time: number, options: ICalendarModalOptions, month?: number): ICalendarDay { const date = DateTimeHelper.parse(time).startOf("day"); const isToday = DateTimeHelper.now().hasSame(date, 'day') - const dayConfig = this.findDayConfig(date, opt); + const dayConfig = this.findDayConfig(date, options); let disable = false; // Check if there is a specific disable configuration for the day - if (dayConfig && isBoolean(dayConfig.disable)) { + if (dayConfig && dayConfig.disable !== undefined) { disable = dayConfig.disable!; } else { // If no specific disable configuration, check if the day is in the list of disabled weekdays - disable = opt.disableWeeks?.indexOf(DateTimeHelper.weekday(date)) !== -1; + const dayOfWeek = DateTimeHelper.weekday(date); + disable = options.disableWeeks?.includes(dayOfWeek) || false; if (!disable) { - const dateFrom = opt.from === undefined ? undefined : DateTimeHelper.parse(opt.from).startOf("day"); - const dateTo = opt.to === undefined ? undefined : DateTimeHelper.parse(opt.to).startOf("day"); - - // Check if the date is between the specified range - if (!(dateFrom === undefined && dateTo === undefined)) { - - let isBetween = true; - if (!opt.canBackwardsSelected) { - if (dateFrom !== undefined && dateTo !== undefined) { - // isBetween = Interval.fromDateTimes(dateFrom, dateTo).contains(date); - isBetween = date >= dateFrom && date <= dateTo; //hack - } - else if (dateFrom !== undefined && dateTo === undefined) { - isBetween = date >= dateFrom; - } - else if (dateFrom === undefined && dateTo !== undefined) { - isBetween = date <= dateTo; - } + const dateFrom = options.from === undefined ? undefined : DateTimeHelper.parse(options.from).startOf("day"); + const dateTo = options.to === undefined ? undefined : DateTimeHelper.parse(options.to).startOf("day"); + + if (!options.canBackwardsSelected) { + // Check if the date is between the specified range + if (dateFrom !== undefined && dateTo !== undefined) { + disable = !(date >= dateFrom && date <= dateTo); + } else if (dateFrom !== undefined) { + disable = date < dateFrom; + } else if (dateTo !== undefined) { + disable = date > dateTo; } - - // Set the disable flag based on whether the date is between the range - disable = !isBetween; } } } // Determine the title and subtitle for the calendar day - const title = dayConfig?.title || opt.defaultTitle || new Date(time).getDate().toString(); - const subTitle = dayConfig?.subTitle || opt.defaultSubtitle || ''; + const title = dayConfig?.title || options.defaultTitle || new Date(time).getDate().toString(); + const subTitle = dayConfig?.subTitle || options.defaultSubtitle || ''; return { time, @@ -204,63 +192,69 @@ export class IonCalendarService { }; } + /** + * Creates a calendar month of a given week. + * + * @param {ICalendarOriginal} original - The original calendar data. + * @param {ICalendarModalOptions} options - The calendar modal options. + * @returns {ICalendarMonth} The calendar month of the given week. + */ private createCalendarMonthOfWeek(original: ICalendarOriginal, options: ICalendarModalOptions): ICalendarMonth { - const { weeks = 1, weekStart, showAdjacentMonthDay, showMonthSubtitle, displayMode } = options; - const { date, year, month, howManyDays } = original; + const { weeks = 1, weekStart, showAdjacentMonthDay, showMonthAdjacentDays, displayMode } = options; + const { date, year, month } = original; const days: ICalendarDay[] = new Array(6).fill(null); - options.continuous = true; //@obsolete - - const calculateStartDay = (currentDate: Date): number => { - const dayOfWeek = currentDate.getDay(); - const result = currentDate.getDate() - (weekStart === 0 ? dayOfWeek : dayOfWeek - 1); - return result >= 0 ? result : 6; + const calculateStartDay = (originalDate: Date): number => { + const dayOfWeek = originalDate.getDay(); + return originalDate.getDate() - (weekStart === 0 ? dayOfWeek : dayOfWeek - 1); }; - const createDay = (dateTime: number, month: number = DateTimeHelper.parse(original.time).month): ICalendarDay => { - if (displayMode == displayModes.week && showMonthSubtitle && - DateTimeHelper.parse(dateTime).month !== month) { - let optClone: ICalendarModalOptions = JSON.parse(JSON.stringify(options)); - let dayConfig: IDayConfig | null = null; - if (optClone.daysConfig !== null && optClone.daysConfig!.length > 0) { - dayConfig = this.findDayConfig(DateTimeHelper.parse(dateTime), optClone); - } + const createDay = (currentTime: number): ICalendarDay => { + const month = DateTimeHelper.parse(original.time).month; + const dateTime = DateTimeHelper.parse(currentTime); + const isDifferentMonth = dateTime.month !== month; + + // Show months in weekdays adjecent of selected month + if (displayMode === displayModes.week && showMonthAdjacentDays && isDifferentMonth) { + const optClone: ICalendarModalOptions = JSON.parse(JSON.stringify(options)); + const dayConfig: IDayConfig | null = this.findDayConfig(dateTime, optClone); if (dayConfig === null) { - if (optClone.daysConfig === null) optClone.daysConfig = [] - optClone.daysConfig!.push({ date: DateTimeHelper.parse(dateTime).toJSDate(), subTitle: DateTimeHelper.parse(dateTime).monthShort! }); + if (!optClone.daysConfig) optClone.daysConfig = []; + optClone.daysConfig.push({ date: dateTime.toJSDate(), subTitle: dateTime.monthShort! }); } - return this.createCalendarDay(dateTime, optClone, month); + return this.createCalendarDay(currentTime, optClone, month); } - return this.createCalendarDay(dateTime, options, month); + + return this.createCalendarDay(currentTime, options, month); }; - let startDay = calculateStartDay(date); + + const startDay = calculateStartDay(date); let startIndex = 0; - for (let i = startIndex; i < 7 * weeks && (options.continuous || startDay + (i - startIndex) <= howManyDays); i++) { + for (let i = startIndex; i < 7 * weeks; i++) { const itemTime = new Date(year, month, startDay + (i - startIndex)).getTime(); days[i] = createDay(itemTime); } if (displayMode === displayModes.month && showAdjacentMonthDay) { const dayExists = days.map(day => !!day); - // const thisMonth = DateTimeHelper.parse(original.time).month; let startOffsetIndex = dayExists.indexOf(true) - 1; let endOffsetIndex = dayExists.lastIndexOf(true) + 1; for (startOffsetIndex; startOffsetIndex >= 0; startOffsetIndex--) { const dayBefore = DateTimeHelper.parse(days[startOffsetIndex + 1].time).minus({ days: 1 }); - days[startOffsetIndex] = createDay(dayBefore.valueOf());//, thisMonth); + days[startOffsetIndex] = createDay(dayBefore.valueOf()); } if (!(dayExists.length % 7 === 0 && dayExists[dayExists.length - 1])) { for (endOffsetIndex; endOffsetIndex < days.length + (endOffsetIndex % 7); endOffsetIndex++) { const dayAfter = DateTimeHelper.parse(days[endOffsetIndex - 1].time).plus({ days: 1 }); - days[endOffsetIndex] = createDay(dayAfter.valueOf());//, thisMonth); + days[endOffsetIndex] = createDay(dayAfter.valueOf()); } } } @@ -270,14 +264,14 @@ export class IonCalendarService { createCalendarMonth(original: ICalendarOriginal, opt: ICalendarModalOptions): ICalendarMonth { const days: Array = new Array(6).fill(null); - const len = original.howManyDays; + const daysInMonth = original.daysInMonth; - for (let i = original.firstWeekDay; i < len + original.firstWeekDay; i++) { + for (let i = original.firstWeekDay; i < daysInMonth + original.firstWeekDay; i++) { const itemTime = new Date(original.year, original.month, i - original.firstWeekDay + 1).getTime(); days[i] = this.createCalendarDay(itemTime, opt); } - if (opt.weekStart === 1) { + if (opt.weekStart == 1) { if (days[0] === null) { days.shift(); } else { diff --git a/projects/ion-calendar/src/lib/models/ICalendarOptions.ts b/projects/ion-calendar/src/lib/models/ICalendarOptions.ts index ae880c1..81b541c 100644 --- a/projects/ion-calendar/src/lib/models/ICalendarOptions.ts +++ b/projects/ion-calendar/src/lib/models/ICalendarOptions.ts @@ -12,7 +12,7 @@ export interface ICalendarOptions { to?: Date | number; pickMode?: PickModeType; disableWeeks?: Array; - weekStart?: number; + weekStart?: 0 | 1; weekdays?: Array; monthFormat?: string; color?: ColorType; @@ -22,9 +22,8 @@ export interface ICalendarOptions { daysConfig?: Array; displayMode?: DisplayModeType; showAdjacentMonthDay?: boolean; - showMonthSubtitle?: boolean; + showMonthAdjacentDays?: boolean; weeks?: number; - continuous?: boolean; } export interface ICalendarModalOptions extends ICalendarOptions { diff --git a/projects/ion-calendar/src/lib/models/ICalendarOriginal.ts b/projects/ion-calendar/src/lib/models/ICalendarOriginal.ts index c237465..914d183 100644 --- a/projects/ion-calendar/src/lib/models/ICalendarOriginal.ts +++ b/projects/ion-calendar/src/lib/models/ICalendarOriginal.ts @@ -1,9 +1,9 @@ export interface ICalendarOriginal { time: number; - date: Date; - year: number; - month: number; - firstWeekDay: number; - howManyDays: number; - lastDay: number; + date: Date; //Date(time) + year: number; //date.getFullYear() + month: number; //date.getMonth() + firstWeekDay: number; //Date(year, month, 1).getDay() + daysInMonth: number; //luxon(time).daysInMonth + lastDayOfMonth: number; //luxon(time).endOf('month').valueOf() } diff --git a/projects/ion-calendar/src/lib/types/index.ts b/projects/ion-calendar/src/lib/types/index.ts index 049c47e..b2072b8 100644 --- a/projects/ion-calendar/src/lib/types/index.ts +++ b/projects/ion-calendar/src/lib/types/index.ts @@ -1,5 +1,5 @@ import { DateObjectUnits, DateTime } from 'luxon'; -import { ICalendarDay, ICalendarLocale } from '../models'; +import { ICalendarLocale } from '../models'; export type DateType = Date | string | number | null; export type CalendarComponentType = 'string' | 'js-date' | 'luxon' | 'time' | 'object'; @@ -7,14 +7,6 @@ export type CalendarComponentPayloadType = string | number | Date | DateTime | D export type CalendarComponentPayloadRangeType = { from: CalendarComponentPayloadType, to: CalendarComponentPayloadType }; export type CalendarComponentOnChangeType = CalendarComponentPayloadType | CalendarComponentPayloadType[] | CalendarComponentPayloadRangeType -// export enum Colors { -// PRIMARY = 'primary', -// SECONDARY = 'secondary', -// DANGER = 'danger', -// LIGHT = 'light', -// DARK = 'dark' -// } - export type ColorType = 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'dark' | 'medium' | 'light' | 'custom' | 'transparent' | ''; export const pickModes = { @@ -40,15 +32,6 @@ const defaultValues = { DATE_FORMAT: 'yyyy-MM-dd', LOCALE: { locale: 'en', weekdays: 'initial' } as ICalendarLocale, YEAR_FORMAT: 'yyyy', - // MONTHS_TITLE: (locale: string = 'en') => { - // return DateTimeHelper.monthsShortTitle(locale); - // }, - // WEEKDAYS_TITLE: (locale: ICalendarLocale = { locale: 'en', weekdays: 'initial', startWeek: 'sunday' }) => { - // return DateTimeHelper.weekDays(locale); - // }, - // MONTHS_TITLE: luxonInfo.months('short', {locale: 'en'}).map(m => m.substring(0, 3).toUpperCase()), //['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'], - // WEEKS_TITLE: luxonInfo.weekdays('short', {locale: 'en'}).map(d => d.substring(0, 1).toUpperCase()), - // WEEKS_TITLE: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], }; export default defaultValues;