"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.charToDate = exports.dateToChar = void 0;
function dateToChar(date) {
    if (date == null) {
        return '';
    }
    let day = date.getDate();
    if (day < 10) {
        // @ts-ignore
        day = '0' + day;
    }
    let month = date.getMonth() + 1;
    if (month < 10) {
        // @ts-ignore
        month = '0' + month;
    }
    return day + '.' + month + '.' + date.getFullYear();
}
exports.dateToChar = dateToChar;
function charToDate(date) {
    if (date == '' || date == null) {
        return null;
    }
    const parts = date.split('.');
    return new Date(parseInt(parts[2]), parseInt(parts[1]) - 1, parseInt(parts[0]));
}
exports.charToDate = charToDate;
