mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-06-15 13:36:35 +02:00
9 lines
304 B
JavaScript
9 lines
304 B
JavaScript
import moment from "moment";
|
|
|
|
function toLocaleDateString(date, { inputFormat, outputFormat = "LLL" } = {}) {
|
|
const parsedDate = inputFormat ? moment(date, inputFormat) : moment(date);
|
|
return parsedDate.locale(ForisTranslations.locale).format(outputFormat);
|
|
}
|
|
|
|
export default toLocaleDateString;
|