mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-03-14 04:42:28 +08:00
init
This commit is contained in:
68
node_modules/date-fns/locale/pl/_lib/formatRelative.js
generated
vendored
Normal file
68
node_modules/date-fns/locale/pl/_lib/formatRelative.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
exports.formatRelative = void 0;
|
||||
var _index = require("../../../isSameWeek.js");
|
||||
|
||||
const adjectivesLastWeek = {
|
||||
masculine: "ostatni",
|
||||
feminine: "ostatnia",
|
||||
};
|
||||
|
||||
const adjectivesThisWeek = {
|
||||
masculine: "ten",
|
||||
feminine: "ta",
|
||||
};
|
||||
|
||||
const adjectivesNextWeek = {
|
||||
masculine: "następny",
|
||||
feminine: "następna",
|
||||
};
|
||||
|
||||
const dayGrammaticalGender = {
|
||||
0: "feminine",
|
||||
1: "masculine",
|
||||
2: "masculine",
|
||||
3: "feminine",
|
||||
4: "masculine",
|
||||
5: "masculine",
|
||||
6: "feminine",
|
||||
};
|
||||
|
||||
function dayAndTimeWithAdjective(token, date, baseDate, options) {
|
||||
let adjectives;
|
||||
if ((0, _index.isSameWeek)(date, baseDate, options)) {
|
||||
adjectives = adjectivesThisWeek;
|
||||
} else if (token === "lastWeek") {
|
||||
adjectives = adjectivesLastWeek;
|
||||
} else if (token === "nextWeek") {
|
||||
adjectives = adjectivesNextWeek;
|
||||
} else {
|
||||
throw new Error(`Cannot determine adjectives for token ${token}`);
|
||||
}
|
||||
|
||||
const day = date.getDay();
|
||||
const grammaticalGender = dayGrammaticalGender[day];
|
||||
|
||||
const adjective = adjectives[grammaticalGender];
|
||||
|
||||
return `'${adjective}' eeee 'o' p`;
|
||||
}
|
||||
|
||||
const formatRelativeLocale = {
|
||||
lastWeek: dayAndTimeWithAdjective,
|
||||
yesterday: "'wczoraj o' p",
|
||||
today: "'dzisiaj o' p",
|
||||
tomorrow: "'jutro o' p",
|
||||
nextWeek: dayAndTimeWithAdjective,
|
||||
other: "P",
|
||||
};
|
||||
|
||||
const formatRelative = (token, date, baseDate, options) => {
|
||||
const format = formatRelativeLocale[token];
|
||||
|
||||
if (typeof format === "function") {
|
||||
return format(token, date, baseDate, options);
|
||||
}
|
||||
|
||||
return format;
|
||||
};
|
||||
exports.formatRelative = formatRelative;
|
||||
Reference in New Issue
Block a user