aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/date-fns/esm/_lib/format/lightFormatters
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
commitd55b767039605256c736166a942a9138e3eacfd7 (patch)
tree947063b634c50d438a794325f13275e134aa5993 /node_modules/date-fns/esm/_lib/format/lightFormatters
parent864ce67d89c77d8ef9c3361f80d619853abcf91c (diff)
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/date-fns/esm/_lib/format/lightFormatters')
-rw-r--r--node_modules/date-fns/esm/_lib/format/lightFormatters/index.js80
1 files changed, 0 insertions, 80 deletions
diff --git a/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js b/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
deleted file mode 100644
index 98c9308..0000000
--- a/node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import addLeadingZeros from "../../addLeadingZeros/index.js";
-/*
- * | | Unit | | Unit |
- * |-----|--------------------------------|-----|--------------------------------|
- * | a | AM, PM | A* | |
- * | d | Day of month | D | |
- * | h | Hour [1-12] | H | Hour [0-23] |
- * | m | Minute | M | Month |
- * | s | Second | S | Fraction of second |
- * | y | Year (abs) | Y | |
- *
- * Letters marked by * are not implemented but reserved by Unicode standard.
- */
-var formatters = {
- // Year
- y: function y(date, token) {
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
- // | Year | y | yy | yyy | yyyy | yyyyy |
- // |----------|-------|----|-------|-------|-------|
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
-
- var signedYear = date.getUTCFullYear();
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
- },
- // Month
- M: function M(date, token) {
- var month = date.getUTCMonth();
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
- },
- // Day of the month
- d: function d(date, token) {
- return addLeadingZeros(date.getUTCDate(), token.length);
- },
- // AM or PM
- a: function a(date, token) {
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
- switch (token) {
- case 'a':
- case 'aa':
- return dayPeriodEnumValue.toUpperCase();
- case 'aaa':
- return dayPeriodEnumValue;
- case 'aaaaa':
- return dayPeriodEnumValue[0];
- case 'aaaa':
- default:
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
- }
- },
- // Hour [1-12]
- h: function h(date, token) {
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
- },
- // Hour [0-23]
- H: function H(date, token) {
- return addLeadingZeros(date.getUTCHours(), token.length);
- },
- // Minute
- m: function m(date, token) {
- return addLeadingZeros(date.getUTCMinutes(), token.length);
- },
- // Second
- s: function s(date, token) {
- return addLeadingZeros(date.getUTCSeconds(), token.length);
- },
- // Fraction of second
- S: function S(date, token) {
- var numberOfDigits = token.length;
- var milliseconds = date.getUTCMilliseconds();
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
- return addLeadingZeros(fractionalSeconds, token.length);
- }
-};
-export default formatters; \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage