{"version":3,"names":["getDate","Date","getCurrentTime","getTime","getDateFromString","dateString","getNiceFormatedDateTime","date","language","text","getNiceFormatedDate","getNiceFormatedTime","dateOptions","day","month","toLocaleDateString","timeOptions","hour","minute","toLocaleTimeString","replace","getNiceFormatedWeekday","weekday","getDaysDiffFromNow","Math","floor","now","parse","toDateString"],"sources":["./src/helpers/dateParser.service.ts"],"sourcesContent":["export function getDate(): Date {\n return new Date();\n}\n\nexport function getCurrentTime() : number {\n return getDate().getTime(); \n}\n\nexport function getDateFromString(dateString: string): Date {\n return new Date(dateString);\n}\n\nexport function oneHourFromNow(): Date {\n var now = getDate();\n var time = getCurrentTime();\n var expireTime = time + 1000 * 60 * 60;\n now.setTime(expireTime);\n return now;\n}\n\nexport function oneHourFromNowAsUtcString(): string {\n return oneHourFromNow().toUTCString();\n}\n\nexport function getNiceFormatedDateTime(date: Date, language: string, text: string): String {\n return getNiceFormatedDate(date, language) + text + getNiceFormatedTime(date, language);\n}\n\nexport function getNiceFormatedDate(date: Date, language: string): String {\n let dateOptions: Intl.DateTimeFormatOptions = {\n day: 'numeric', month: 'short'\n };\n\n return date.toLocaleDateString(language, dateOptions);\n}\n\nexport function getNiceFormatedTime(date: Date, language: string): String {\n let timeOptions: Intl.DateTimeFormatOptions = {\n hour: '2-digit', minute: '2-digit'\n };\n\n return date.toLocaleTimeString(language, timeOptions).replace(':', '.');\n}\n\nexport function getNiceFormatedWeekday(date: Date, language: string): String {\n let dateOptions: Intl.DateTimeFormatOptions = {\n weekday: 'long'\n };\n\n return date.toLocaleDateString(language, dateOptions);\n}\n\nexport function getDaysDiffFromNow(date: Date) : number {\n return Math.floor( ( (Date.now() - Date.parse(date.toDateString())) / 1000 ) / 86400 );\n}\n\n"],"mappings":"SAAgBA,IACZ,OAAO,IAAIC,IACf,C,SAEgBC,IACZ,OAAOF,IAAUG,SACrB,C,SAEgBC,EAAkBC,GAC9B,OAAO,IAAIJ,KAAKI,EACpB,C,SAcgBC,EAAwBC,EAAYC,EAAkBC,GAClE,OAAOC,EAAoBH,EAAMC,GAAYC,EAAOE,EAAoBJ,EAAMC,EAClF,C,SAEgBE,EAAoBH,EAAYC,GAC5C,IAAII,EAA0C,CAC1CC,IAAK,UAAWC,MAAO,SAG3B,OAAOP,EAAKQ,mBAAmBP,EAAUI,EAC7C,C,SAEgBD,EAAoBJ,EAAYC,GAC5C,IAAIQ,EAA0C,CAC1CC,KAAM,UAAWC,OAAQ,WAG7B,OAAOX,EAAKY,mBAAmBX,EAAUQ,GAAaI,QAAQ,IAAK,IACvE,C,SAEgBC,EAAuBd,EAAYC,GAC/C,IAAII,EAA0C,CAC1CU,QAAS,QAGb,OAAOf,EAAKQ,mBAAmBP,EAAUI,EAC7C,C,SAEgBW,EAAmBhB,GAC/B,OAAOiB,KAAKC,OAAUxB,KAAKyB,MAAQzB,KAAK0B,MAAMpB,EAAKqB,iBAAmB,IAAS,MACnF,Q"}