Skip to content

Latest commit

 

History

History
80 lines (58 loc) · 2.17 KB

File metadata and controls

80 lines (58 loc) · 2.17 KB

import * as UI from "../../lib";

import { Canvas, Meta, Story } from "@storybook/addon-docs";

formatDateTime

API documentation

{UI.widgets.formatDateTime( new Date(), "{FullYear}-{Month}-{Date}T{Hours}:{Minutes}:{Seconds}.{Milliseconds}" )} {UI.widgets.formatDateTime(new Date(), "{Date}.{Month}.{Year}")} {UI.widgets.formatDateTime(new Date(), "{Hours}:{Minutes}:{Seconds}")}

shortDate

By default, converts e.g. '2020-02-19T19:35:28.557Z' to '19:35' if today is 19 Feb 2020, and to 'Feb 19' if not.

API documentation

{UI.widgets.shortDate("2020-01-01T15:43", true)} {UI.widgets.shortDate("2020-01-01T15:43", false)} {UI.widgets.shortDate(new Date().toISOString(), true)} {UI.widgets.shortDate(new Date().toISOString(), false)}

shortTime

Get a short string representation of the current time

API documentation

{UI.widgets.shortTime()}

timestamp

Get a string representation of the current time

API documentation

{UI.widgets.timestamp()}