(date, dateFormat, timeZone, is12Hour)
| 733 | }; |
| 734 | |
| 735 | export function formatDateTime(date, dateFormat, timeZone, is12Hour) { |
| 736 | const zonedDate = toZonedTime(date, timeZone); // Convert date to the given timezone |
| 737 | const timeFormat = is12Hour ? 'hh:mm:ss a' : 'HH:mm:ss'; |
| 738 | return dateFormat |
| 739 | ? format(zonedDate, `${selectFormat(dateFormat)}, ${timeFormat} 'GMT' XXX`, { timeZone }) |
| 740 | : formatTimeInTimezone(date, timeZone); |
| 741 | } |
| 742 | |
| 743 | export const randomId = (digit = 8) => { |
| 744 | // 1. Grab a cryptographically-secure 32-bit random value |
no test coverage detected