Rocky_Mountain_Vending/.pnpm-store/v10/files/4d/e14089d7da63d61505d1b4945de32c56e3cf6e3ef6d6b395f366c2c5cdcba145aeedff3f7bab3f8e4422518d0bd36488aa8d5bb9359c3de4e6d23c8a0fdb2a
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

109 lines
3.3 KiB
Text

"use strict";
exports.lightFormatters = void 0;
var _index = require("../addLeadingZeros.cjs");
var _index2 = require("../../_core/getMonth.cjs");
var _index3 = require("../../_core/getDate.cjs");
var _index4 = require("../../_core/getFullYear.cjs");
/*
* | | 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.
*/
const lightFormatters = (exports.lightFormatters = {
// Year
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 |
const signedYear = (0, _index4.getFullYear)(date);
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return (0, _index.addLeadingZeros)(
token === "yy" ? year % 100 : year,
token.length,
);
},
// Month
M(date, token) {
const month = (0, _index2.getMonth)(date);
return token === "M"
? String(month + 1)
: (0, _index.addLeadingZeros)(month + 1, 2);
},
// Day of the month
d(date, token) {
return (0, _index.addLeadingZeros)(
(0, _index3.getDate)(date),
token.length,
);
},
// AM or PM
a(date, token) {
const dayPeriodEnumValue = date.getHours() / 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(date, token) {
return (0, _index.addLeadingZeros)(
date.getHours() % 12 || 12,
token.length,
);
},
// Hour [0-23]
H(date, token) {
return (0, _index.addLeadingZeros)(date.getHours(), token.length);
},
// Minute
m(date, token) {
return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
},
// Second
s(date, token) {
return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
},
// Fraction of second
S(date, token) {
const numberOfDigits = token.length;
const milliseconds = date.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, numberOfDigits - 3),
);
return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
},
});