MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / formatDateTime

Function formatDateTime

apps/OpenSignServer/Utils.js:735–741  ·  view source on GitHub ↗
(date, dateFormat, timeZone, is12Hour)

Source from the content-addressed store, hash-verified

733};
734
735export 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
743export const randomId = (digit = 8) => {
744 // 1. Grab a cryptographically-secure 32-bit random value

Callers 2

formatDateStrFunction · 0.90
GenerateCertificateFunction · 0.90

Calls 3

formatFunction · 0.85
selectFormatFunction · 0.70
formatTimeInTimezoneFunction · 0.70

Tested by

no test coverage detected