var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { getMonthInHumanFormat } from '../../components/Calendar/CalendarUtils.js';
export var getDateForNative = function (componentDate) {
    if (!componentDate) {
        return undefined;
    }
    var splittedDate = componentDate.split('.');
    return "".concat(splittedDate[2], "-").concat(splittedDate[1], "-").concat(splittedDate[0]);
};
export var getDateForComponent = function (nativeDate) {
    if (!nativeDate) {
        return '';
    }
    var splittedDate = nativeDate.split('-');
    return "".concat(splittedDate[2], ".").concat(splittedDate[1], ".").concat(splittedDate[0]);
};
export var getNativeDateFromShape = function (componentDate) {
    if (!componentDate) {
        return undefined;
    }
    var _a = [componentDate.date, componentDate.month, componentDate.year].map(function (x) { return x.toString(); }), date = _a[0], month = _a[1], year = _a[2];
    return "".concat(year.padStart(4, '0'), "-").concat(month.padStart(2, '0'), "-").concat(date.padStart(2, '0'));
};
export var upMonthOfShape = function (DateShape) {
    if (!DateShape) {
        return undefined;
    }
    return __assign(__assign({}, DateShape), { month: getMonthInHumanFormat(DateShape.month) });
};
export var getShapeFromNativeDate = function (nativeDate) {
    if (!nativeDate) {
        return undefined;
    }
    var splittedDate = nativeDate.split('-').map(function (date) { return Number(date); });
    return { year: splittedDate[0], month: splittedDate[1], date: splittedDate[2] };
};
//# sourceMappingURL=utils.js.map