Added JSDoc for src/

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
Matthew Nickson
2023-01-05 22:55:51 +00:00
parent caff9ca736
commit dc8289df12
10 changed files with 119 additions and 1 deletions

View File

@@ -352,6 +352,11 @@ export function getMonitorRelativeURL(id: string) {
return "/dashboard/" + id;
}
/**
* Get relative path for maintenance
* @param id ID of maintenance
* @returns Formatted relative path
*/
export function getMaintenanceRelativeURL(id: string) {
return "/maintenance/" + id;
}
@@ -405,7 +410,11 @@ export function parseTimeFromTimeObject(obj : any) {
return result;
}
/**
* Convert ISO date to UTC
* @param input Date
* @returns ISO Date time
*/
export function isoToUTCDateTime(input : string) {
return dayjs(input).utc().format(SQL_DATETIME_FORMAT);
}
@@ -424,6 +433,12 @@ export function utcToLocal(input : string, format = SQL_DATETIME_FORMAT) {
return dayjs.utc(input).local().format(format);
}
/**
* Convert local datetime to UTC
* @param input Local date
* @param format Format to return
* @returns Date in requested format
*/
export function localToUTC(input : string, format = SQL_DATETIME_FORMAT) {
return dayjs(input).utc().format(format);
}