aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/date-fns/esm/formatDistanceToNowStrict
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-28 17:26:46 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-28 17:43:56 -0700
commite4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 (patch)
tree06284a538a6008eca75051399e47db4e5d50301c /node_modules/date-fns/esm/formatDistanceToNowStrict
initial commit: scaffolding
Diffstat (limited to 'node_modules/date-fns/esm/formatDistanceToNowStrict')
-rw-r--r--node_modules/date-fns/esm/formatDistanceToNowStrict/index.d.ts4
-rw-r--r--node_modules/date-fns/esm/formatDistanceToNowStrict/index.js80
-rw-r--r--node_modules/date-fns/esm/formatDistanceToNowStrict/index.js.flow60
-rw-r--r--node_modules/date-fns/esm/formatDistanceToNowStrict/package.json4
4 files changed, 148 insertions, 0 deletions
diff --git a/node_modules/date-fns/esm/formatDistanceToNowStrict/index.d.ts b/node_modules/date-fns/esm/formatDistanceToNowStrict/index.d.ts
new file mode 100644
index 0000000..4f00e65
--- /dev/null
+++ b/node_modules/date-fns/esm/formatDistanceToNowStrict/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceToNowStrict } from 'date-fns'
+export default formatDistanceToNowStrict
diff --git a/node_modules/date-fns/esm/formatDistanceToNowStrict/index.js b/node_modules/date-fns/esm/formatDistanceToNowStrict/index.js
new file mode 100644
index 0000000..156afb9
--- /dev/null
+++ b/node_modules/date-fns/esm/formatDistanceToNowStrict/index.js
@@ -0,0 +1,80 @@
+import formatDistanceStrict from "../formatDistanceStrict/index.js";
+import requiredArgs from "../_lib/requiredArgs/index.js";
+/**
+ * @name formatDistanceToNowStrict
+ * @category Common Helpers
+ * @summary Return the distance between the given date and now in words.
+ * @pure false
+ *
+ * @description
+ * Return the distance between the given dates in words, using strict units.
+ * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
+ * 'less than' and the like.
+ *
+ * | Distance between dates | Result |
+ * |------------------------|---------------------|
+ * | 0 ... 59 secs | [0..59] seconds |
+ * | 1 ... 59 mins | [1..59] minutes |
+ * | 1 ... 23 hrs | [1..23] hours |
+ * | 1 ... 29 days | [1..29] days |
+ * | 1 ... 11 months | [1..11] months |
+ * | 1 ... N years | [1..N] years |
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - an object with options.
+ * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
+ * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
+ * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @returns {String} the distance in words
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.locale` must contain `formatDistance` property
+ *
+ * @example
+ * // If today is 1 January 2015, what is the distance to 2 July 2014?
+ * const result = formatDistanceToNowStrict(
+ * new Date(2014, 6, 2)
+ * )
+ * //=> '6 months'
+ *
+ * @example
+ * // If now is 1 January 2015 00:00:00,
+ * // what is the distance to 1 January 2015 00:00:15, including seconds?
+ * const result = formatDistanceToNowStrict(
+ * new Date(2015, 0, 1, 0, 0, 15)
+ * )
+ * //=> '15 seconds'
+ *
+ * @example
+ * // If today is 1 January 2015,
+ * // what is the distance to 1 January 2016, with a suffix?
+ * const result = formatDistanceToNowStrict(
+ * new Date(2016, 0, 1),
+ * {addSuffix: true}
+ * )
+ * //=> 'in 1 year'
+ *
+ * @example
+ * // If today is 28 January 2015,
+ * // what is the distance to 1 January 2015, in months, rounded up??
+ * const result = formatDistanceToNowStrict(new Date(2015, 0, 1), {
+ * unit: 'month',
+ * roundingMethod: 'ceil'
+ * })
+ * //=> '1 month'
+ *
+ * @example
+ * // If today is 1 January 2015,
+ * // what is the distance to 1 January 2016 in Esperanto?
+ * const eoLocale = require('date-fns/locale/eo')
+ * const result = formatDistanceToNowStrict(
+ * new Date(2016, 0, 1),
+ * {locale: eoLocale}
+ * )
+ * //=> '1 jaro'
+ */
+export default function formatDistanceToNowStrict(dirtyDate, options) {
+ requiredArgs(1, arguments);
+ return formatDistanceStrict(dirtyDate, Date.now(), options);
+} \ No newline at end of file
diff --git a/node_modules/date-fns/esm/formatDistanceToNowStrict/index.js.flow b/node_modules/date-fns/esm/formatDistanceToNowStrict/index.js.flow
new file mode 100644
index 0000000..49fbade
--- /dev/null
+++ b/node_modules/date-fns/esm/formatDistanceToNowStrict/index.js.flow
@@ -0,0 +1,60 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ locale?: Locale,
+ }
+) => string
diff --git a/node_modules/date-fns/esm/formatDistanceToNowStrict/package.json b/node_modules/date-fns/esm/formatDistanceToNowStrict/package.json
new file mode 100644
index 0000000..b109f05
--- /dev/null
+++ b/node_modules/date-fns/esm/formatDistanceToNowStrict/package.json
@@ -0,0 +1,4 @@
+{
+ "sideEffects": false,
+ "typings": "../../typings.d.ts"
+} \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage