@tmlmobilidade/utils
Version:
This package provides a collection of common utility functions used across projects within the organization.
100 lines (99 loc) • 1.59 kB
JavaScript
const l = 'long', n = 'numeric', s = 'short';
const DATE_SHORT = {
day: n,
month: n,
year: n,
};
const DATE_MEDIUM = {
day: n,
month: s,
year: n,
};
const DATE_FULL = {
day: n,
month: l,
};
const DATE_FULL_WITH_YEAR = {
day: n,
month: l,
year: n,
};
const DATE_HUGE = {
day: n,
month: l,
weekday: l,
year: n,
};
const TIME_SIMPLE = {
hour: n,
minute: n,
};
const TIME_WITH_SECONDS = {
hour: n,
minute: n,
second: n,
};
const DATETIME_SHORT = {
day: n,
hour: n,
minute: n,
month: n,
year: n,
};
const DATETIME_SHORT_WITH_SECONDS = {
day: n,
hour: n,
minute: n,
month: n,
second: n,
year: n,
};
const DATETIME_MEDIUM = {
day: n,
hour: n,
minute: n,
month: s,
year: n,
};
const DATETIME_MEDIUM_WITH_SECONDS = {
day: n,
hour: n,
minute: n,
month: s,
second: n,
year: n,
};
const DATETIME_FULL = {
day: n,
hour: n,
minute: n,
month: l,
timeZoneName: s,
year: n,
};
const DATETIME_FULL_WITH_SECONDS = {
day: n,
hour: n,
minute: n,
month: l,
second: n,
timeZoneName: s,
year: n,
};
export const OPERATIONAL_DATE_FORMAT = 'yyyyMMdd';
export const Formats = {
DATE_FULL,
DATE_FULL_WITH_YEAR,
DATE_HUGE,
DATE_MEDIUM,
DATE_SHORT,
DATETIME_FULL,
DATETIME_FULL_WITH_SECONDS,
DATETIME_MEDIUM,
DATETIME_MEDIUM_WITH_SECONDS,
DATETIME_SHORT,
DATETIME_SHORT_WITH_SECONDS,
OPERATIONAL_DATE_FORMAT,
TIME_SIMPLE,
TIME_WITH_SECONDS,
};