tell-me-when
Version:
human relative date and time parser
2 lines (1 loc) • 2.82 kB
Source Map (JSON)
{"version":3,"file":"DateFn.mjs","names":[],"sources":["src/DateFn.ts"],"sourcesContent":["export type DateFn =\n /**\n * Set Date to now\n */\n | ['now']\n /**\n * Set year of date to the given value\n */\n | ['setYear', number]\n /**\n * Set month of date to the given value (0-11)\n */\n | ['setMonth', number]\n /**\n * Set day of month of date to the given value (1-31)\n */\n | ['setDate', number]\n /**\n * Set day of week of date to the given value\n */\n | ['setDay', number]\n /**\n * Set hour of date to the given value\n */\n | ['setHours', number]\n /**\n * Set minutes of date to the given value\n */\n | ['setMinutes', number]\n /**\n * Set seconds of date to the given value\n */\n | ['setSeconds', number]\n /**\n * Set milliseconds of date to the given value\n */\n | ['setMilliseconds', number]\n | AddFn\n /**\n * Set date to the start of its current year\n */\n | ['startOfYear']\n /**\n * Set date to the start of its current month\n */\n | ['startOfMonth']\n /**\n * Set date to the start of its current week\n */\n | ['startOfWeek']\n /**\n * Set date to the start of its current day\n */\n | ['startOfDay']\n /**\n * Set date to the start of its current hour\n */\n | ['startOfHour']\n /**\n * Set date to the start of its current minute\n */\n | ['startOfMinute']\n /**\n * Set date to the start of its current second\n */\n | ['startOfSecond']\n /**\n * Make an interval from the current date to the result of\n * applying the given DateFns to it\n */\n | ['makeInterval', ...DateFn[]]\n /**\n * If the current date is before now, apply beforeNow DateFns;\n * if it is after now, apply afterNow DateFns\n */\n | ['if', { beforeNow?: DateFn[]; afterNow?: DateFn[] }]\n /**\n * Select whichever is closer to now: the result of applying\n * `a` DateFns to the current date, or the result of applying\n * `b` DateFns to the current date\n */\n | ['closestToNow', a: DateFn[], b: DateFn[]]\n\nexport type AddFn =\n /**\n * Add the given number of years to the date\n */\n | ['addYears', number]\n /**\n * Add the given number of months to the date\n */\n | ['addMonths', number]\n /**\n * Add the given number of weeks to the date\n */\n | ['addWeeks', number]\n /**\n * Add the given number of days to the date\n */\n | ['addDays', number]\n /**\n * Add the given number of hours to the date\n */\n | ['addHours', number]\n /**\n * Add the given number of minutes to the date\n */\n | ['addMinutes', number]\n /**\n * Add the given number of seconds to the date\n */\n | ['addSeconds', number]\n /**\n * Add the given number of milliseconds to the date\n */\n | ['addMilliseconds', number]\n"],"mappings":"","ignoreList":[]}