* Converts a date value string to a timestamp. * @param dateValue - Date string to convert * @returns timestamp in seconds, or 0 if invalid * @private
(dateValue?: string)
| 903 | * @private |
| 904 | */ |
| 905 | _getTimestampFromDateValue(dateValue?: string): number { |
| 906 | if (!dateValue) { |
| 907 | return 0; |
| 908 | } |
| 909 | |
| 910 | try { |
| 911 | const jsDate = this.getValueFormat().parse(dateValue) as Date; |
| 912 | const calendarDate = CalendarDate.fromLocalJSDate( |
| 913 | jsDate, |
| 914 | this._primaryCalendarType, |
| 915 | ); |
| 916 | return calendarDate.valueOf() / 1000; |
| 917 | } catch { |
| 918 | return 0; |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | _isDayPressed(target: HTMLElement): boolean { |
| 923 | const targetParent = target.parentNode as HTMLElement; |
no test coverage detected