package.cjs.utils.datetime.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"datetime.js","names":["_dayjs","_interopRequireDefault","require","getDefaultFormat","_globalProps$user$dat","_globalProps","_globalProps$user","globalProps","user","dateFormat","timeFormat","fromNow","time","dayjs","format","timeWithSeconds","date","dateWeek","dateWeekDayExtended","dateWeekWithoutYear","dateWeekWithoutYearDayExtended","dateTime","dateTimeWithSeconds","dateWeekTime","dateWeekTimeDayExtended","extended","concat","_default","defaultWithTime","exports"],"sources":["../../../src/utils/datetime.js"],"sourcesContent":["/* eslint-disable @bigbinary/neeto/use-standard-date-time-formats */\nimport dayjs from \"./dayjs\";\n\nconst getDefaultFormat = () => globalProps?.user?.dateFormat ?? \"DD/MM/YYYY\";\n\nexport const timeFormat = {\n fromNow: time => dayjs(time).fromNow(),\n time: time => dayjs(time).format(\"LT\"),\n timeWithSeconds: time => dayjs(time).format(\"LTS\"),\n date: time => dayjs(time).format(\"ll\"),\n dateWeek: time => dayjs(time).format(\"ll ddd\"),\n dateWeekDayExtended: time => dayjs(time).format(\"ll dddd\"),\n dateWeekWithoutYear: time => dayjs(time).format(\"MMM D, ddd\"),\n dateWeekWithoutYearDayExtended: time => dayjs(time).format(\"MMM D, dddd\"),\n dateTime: time => dayjs(time).format(\"ll LT\"),\n dateTimeWithSeconds: time => dayjs(time).format(\"ll LTS\"),\n dateWeekTime: time => dayjs(time).format(\"ll ddd LT\"),\n dateWeekTimeDayExtended: time => dayjs(time).format(\"ll dddd LT\"),\n extended: time => {\n const dateTime = dayjs(time).format(\"dddd LL LT\");\n const fromNow = dayjs(time).fromNow();\n\n return `${dateTime} (${fromNow})`;\n },\n default: time => dayjs(time).format(getDefaultFormat()),\n defaultWithTime: time => dayjs(time).format(`${getDefaultFormat()} LTS`),\n};\n\nexport const dateForm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