Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1x 1x 2x 2x 2x 1x | import { none, Option } from "@reactive-js/core/lib/option"; import { HttpDateTime } from "./interfaces"; export const parseHttpDateTime = (v: string): Option<HttpDateTime> => { const asDate = new Date(v); const result = asDate.getTime(); return v !== "" && !Number.isNaN(result) ? result : none; }; export const httpDateTimeToString = (v: HttpDateTime): string => { const date = new Date(v); return date.toUTCString(); }; |