Date functions and time helpers.
- SWR Audio Lab / Date
- Install
getDateHourMinutes- get date with hours and minutesgetDayMonthYear- get date with month and yeargetFullRelativeTime- get full date with relative yearsgetHourMinutes- get hours and minutes from iso dategetIsoRelativeTime- get iso date with relative yearsgetRelativeTime- get relative years from iso dategetYearMonthDay- get YYYYMMDD from iso daterevYearMonthDay- get DDMMYYYY from YYYYMMDD
Add the parent package to your dependencies:
yarn add @swrlab/utilsvalue(required) - Date as ISO string
Import the library:
const { getDateHourMinutes } = require('@swrlab/utils/packages/date')Then use the toolkit:
getDateHourMinutes('2038-01-19T03:14:08.000')
// 'Di, 19. Januar 2038 - 03:14 Uhr'value(required) - Date as ISO string
Import the library:
const { getDayMonthYear } = require('@swrlab/utils/packages/date')Then use the toolkit:
getDayMonthYear('2038-01-19T03:14:08.000')
// 'Di, 19. Januar 2038'value(required) - Date as ISO string
Import the library:
const { getFullRelativeTime } = require('@swrlab/utils/packages/date')Then use the toolkit:
getFullRelativeTime('2038-01-19T03:14:08.000')
// 'Di, 19. Januar 2038 - 03:14 Uhr (in YY Jahren)'value(required) - Date as ISO string
Import the library:
const { getHourMinutes } = require('@swrlab/utils/packages/date')Then use the toolkit:
getHourMinutes('2038-01-19T03:14:08.000')
// '03:14'value(required) - Date as ISO string
Import the library:
const { getIsoRelativeTime } = require('@swrlab/utils/packages/date')Then use the toolkit:
getIsoRelativeTime('2038-01-19T03:14:08.000')
// '2038-01-19T03:14:08.000 (in YY Jahren)'value(required) - Date as ISO string
Import the library:
const { getRelativeTime } = require('@swrlab/utils/packages/date')Then use the toolkit:
getRelativeTime('2038-01-19T03:14:08.000')
// '(in YY Jahren)'value(required) - Date as ISO string
Import the library:
const { getYearMonthDay } = require('@swrlab/utils/packages/date')Then use the toolkit:
getYearMonthDay('2038-01-19T03:14:08.000')
// '20380119'value(required) - Date asYYYYMMDDstring
Import the library:
const { revYearMonthDay } = require('@swrlab/utils/packages/date')Then use the toolkit:
revYearMonthDay('20380119')
// '19012038'