"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertStringToDate = void 0;
var date_fns_1 = require("date-fns");
function convertStringToDate(dateString) {
    try {
        if (date_fns_1.format(date_fns_1.parse(dateString, 'yyyyMMddHHmmss', new Date()), 'yyyyMMddHHmmss') === dateString) {
            return date_fns_1.parse(dateString, 'yyyyMMddHHmmss', new Date());
        }
    }
    catch (e) { }
    try {
        if (date_fns_1.format(date_fns_1.parse(dateString, 'yyyy/MM/dd', new Date()), 'yyyy/MM/dd') === dateString) {
            return date_fns_1.parse(dateString, 'yyyy/MM/dd', new Date());
        }
    }
    catch (e) { }
    try {
        if (date_fns_1.format(date_fns_1.parse(dateString, 'yyyy-MM-dd', new Date()), 'yyyy-MM-dd') === dateString) {
            return date_fns_1.parse(dateString, 'yyyy-MM-dd', new Date());
        }
    }
    catch (e) { }
    return date_fns_1.parseISO(dateString);
}
exports.convertStringToDate = convertStringToDate;
//# sourceMappingURL=date-utils.service.js.map