mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-21 04:09:39 +08:00
Generated documentation :)
This commit is contained in:
@@ -7,6 +7,12 @@ import { localeDirection, currentLocale } from "./i18n";
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
||||
/**
|
||||
* Returns the offset from UTC in hours for the current locale.
|
||||
* @returns {number} The offset from UTC in hours.
|
||||
*
|
||||
* Generated by Trelent
|
||||
*/
|
||||
function getTimezoneOffset(timeZone) {
|
||||
const now = new Date();
|
||||
const tzString = now.toLocaleString("en-US", {
|
||||
@@ -18,7 +24,14 @@ function getTimezoneOffset(timeZone) {
|
||||
return -offset;
|
||||
}
|
||||
|
||||
export function timezoneList() {
|
||||
export /**
|
||||
* Returns a list of timezones sorted by their offset from UTC.
|
||||
* @param {Array} timezones - An array of timezone objects.
|
||||
* @returns {Array} A list of the given timezones sorted by their offset from UTC.
|
||||
*
|
||||
* Generated by Trelent
|
||||
*/
|
||||
function timezoneList() {
|
||||
let result = [];
|
||||
|
||||
for (let timezone of timezones) {
|
||||
|
Reference in New Issue
Block a user