test/static/js/ol/mapCommonFuncs.js
2025-02-14 11:12:13 +07:00

11 lines
656 B
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.

function formatDateToRussian(date) {
const day = String(date.getDate()).padStart(2, '0'); // День (с ведущим нулем)
const month = String(date.getMonth() + 1).padStart(2, '0'); // Месяц (с ведущим нулем, +1 так как месяцы начинаются с 0)
const year = date.getFullYear(); // Год
const hours = String(date.getHours()).padStart(2, '0'); // Часы
const minutes = String(date.getMinutes()).padStart(2, '0'); // Минуты
const seconds = String(date.getSeconds()).padStart(2, '0'); // Секунды
return `${day}.${month}.${year} ${hours}:${minutes}:${seconds}`;
}