about summary refs log tree commit diff
path: root/src/components/forms/DateField/utils.ts
blob: 04bb482ce151189a31cc844d34d7a48f58f83562 (plain) (blame)
1
2
3
4
5
// 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]
}