Added JSDoc for src/*

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
Matthew Nickson
2022-06-02 14:32:38 +01:00
parent b0476cfb5b
commit c94dcf1533
3 changed files with 135 additions and 18 deletions

View File

@@ -26,8 +26,8 @@ function getTimezoneOffset(timeZone) {
/**
* 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.
* @param {Object[]} timezones An array of timezone objects.
* @returns {Object[]} A list of the given timezones sorted by their offset from UTC.
*
* Generated by Trelent
*/
@@ -63,6 +63,7 @@ export function timezoneList() {
return result;
}
/** Set the locale of the HTML page */
export function setPageLocale() {
const html = document.documentElement;
html.setAttribute("lang", currentLocale() );
@@ -70,7 +71,9 @@ export function setPageLocale() {
}
/**
* Get the base URL
* Mainly used for dev, because the backend and the frontend are in different ports.
* @returns {string}
*/
export function getResBaseURL() {
const env = process.env.NODE_ENV;