From c6465b13357a1e43f56a61a1d312c1823f035dd3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 18 Jun 2024 16:58:17 -0500 Subject: [PATCH] Revert change to unrelated code --- src/components/forms/DateField/utils.ts | 6 +++++- src/lib/strings/time.ts | 8 -------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/components/forms/DateField/utils.ts b/src/components/forms/DateField/utils.ts index 853e009b0c..c787272fe8 100644 --- a/src/components/forms/DateField/utils.ts +++ b/src/components/forms/DateField/utils.ts @@ -2,7 +2,11 @@ import {getLocales} from 'expo-localization' const LOCALE = getLocales()[0] -export {toSimpleDateString} from '#/lib/strings/time' +// we need the date in the form yyyy-MM-dd to pass to the input +export function toSimpleDateString(date: Date | string): string { + const _date = typeof date === 'string' ? new Date(date) : date + return _date.toISOString().split('T')[0] +} export function localizeDate(date: Date | string): string { const _date = typeof date === 'string' ? new Date(date) : date diff --git a/src/lib/strings/time.ts b/src/lib/strings/time.ts index fde66e8eb0..bfefea9bc3 100644 --- a/src/lib/strings/time.ts +++ b/src/lib/strings/time.ts @@ -20,14 +20,6 @@ export function getAge(birthDate: Date): number { return age } -/** - * Returns date string in yyyy-MM-dd format - */ -export function toSimpleDateString(date: Date | string): string { - const _date = typeof date === 'string' ? new Date(date) : date - return _date.toISOString().split('T')[0] -} - /** * Compares two dates by year, month, and day only */