mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 22:17:40 +08:00
fix(datetime): fix edge cases with datetime and invalid values (#17769)
* fix edge cases with datetime and invalid values * clean up code * revert let changes * run linter
This commit is contained in:
@ -247,8 +247,8 @@ export function parseDate(val: string | undefined | null): DatetimeData | undefi
|
||||
* Note: This is not meant for time strings
|
||||
* such as "01:47"
|
||||
*/
|
||||
export const getLocalDateTime = (dateString = ''): Date => {
|
||||
const date = (dateString.length > 0) ? new Date(dateString) : new Date();
|
||||
export const getLocalDateTime = (dateString: any = ''): Date => {
|
||||
const date = (typeof dateString === 'string' && dateString.length > 0) ? new Date(dateString) : new Date();
|
||||
|
||||
return new Date(
|
||||
Date.UTC(
|
||||
|
Reference in New Issue
Block a user