timepiece/node_modules/date-fns/locale/sr/_lib/formatRelative.js

49 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: (date) => {
const day = date.getDay();
switch (day) {
case 0:
return "'прошле недеље у' p";
case 3:
return "'прошле среде у' p";
case 6:
return "'прошле суботе у' p";
default:
return "'прошли' EEEE 'у' p";
}
},
yesterday: "'јуче у' p",
today: "'данас у' p",
tomorrow: "'сутра у' p",
nextWeek: (date) => {
const day = date.getDay();
switch (day) {
case 0:
return "'следеће недеље у' p";
case 3:
return "'следећу среду у' p";
case 6:
return "'следећу суботу у' p";
default:
return "'следећи' EEEE 'у' p";
}
},
other: "P",
};
const formatRelative = (token, date, _baseDate, _options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};
exports.formatRelative = formatRelative;