diff options
Diffstat (limited to 'code/app/src')
| -rw-r--r-- | code/app/src/help/index.ts | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/code/app/src/help/index.ts b/code/app/src/help/index.ts index a69228e..0e6fd8b 100644 --- a/code/app/src/help/index.ts +++ b/code/app/src/help/index.ts @@ -1,24 +1,11 @@ import {browser} from "$app/environment"; -import type {WorkEntry} from "$models/work/WorkEntry"; import {log_info} from "./logger"; -import {Temporal} from "temporal-polyfill"; export const EMAIL_REGEX = new RegExp(/^([a-z0-9]+(?:([._\-])[a-z0-9]+)*@(?:[a-z0-9]+(?:(-)[a-z0-9]+)?\.)+[a-z0-9](?:[a-z0-9]*[a-z0-9])?)$/i); export const URL_REGEX = new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-.][a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/gm); export const GUID_REGEX = new RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i); export const NORWEGIAN_PHONE_NUMBER_REGEX = new RegExp(/(0047|\+47|47)?\d{8,12}/); -export function get_default_sorted(unsorted: Array<WorkEntry>): Array<WorkEntry> { - if (unsorted.length < 1) return unsorted; - const byStart = unsorted.sort((a, b) => { - return Temporal.Instant.compare(Temporal.Instant.from(b.start), Temporal.Instant.from(a.start)); - }); - - return byStart.sort((a, b) => { - return Temporal.Instant.compare(Temporal.Instant.from(b.stop), Temporal.Instant.from(a.stop)); - }); -} - export function get_element_by_pw_key(key: string): HTMLElement | null { return document.querySelector("[pw-key='" + key + "']"); } |
