mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
4.1 KiB
JSON
1 line
4.1 KiB
JSON
{"ast":null,"code":"function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}\nfunction showDateDuration(start) {\n let end;\n end = new Date();\n start = new Date(start);\n let customizedDate;\n const totalSeconds = Math.floor((end - start) / 1000);\n ;\n const totalMinutes = Math.floor(totalSeconds / 60);\n const totalHours = Math.floor(totalMinutes / 60);\n const totalDays = Math.floor(totalHours / 24);\n const hours = totalHours - totalDays * 24;\n const minutes = totalMinutes - totalDays * 24 * 60 - hours * 60;\n const seconds = totalSeconds - totalDays * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;\n if (totalDays == 0) {\n if (start.getDate() == new Date().getDate()) {\n let time = start.getHours() + \":\" + addZero(start.getUTCMinutes());\n return time;\n } else {\n return 'Ontem';\n }\n } else {\n let date = addZero(start.getDate()) + \"/\" + addZero(start.getMonth() + 1) + \"/\" + start.getFullYear();\n return date;\n }\n}\nmodule.exports = {\n showDateDuration: showDateDuration\n};","map":{"version":3,"names":["addZero","i","showDateDuration","start","end","Date","customizedDate","totalSeconds","Math","floor","totalMinutes","totalHours","totalDays","hours","minutes","seconds","getDate","time","getHours","getUTCMinutes","date","getMonth","getFullYear","module","exports"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/src/plugin/showDateDuration.js"],"sourcesContent":["\r\nfunction addZero(i) {\r\n if (i < 10) {\r\n i = \"0\" + i;\r\n }\r\n return i;\r\n}\r\n\r\nfunction showDateDuration(start) {\r\n let end;\r\n end = new Date();\r\n start = new Date(start);\r\n let customizedDate;\r\n\r\n\r\n const totalSeconds = Math.floor((end - (start))/1000);;\r\n const totalMinutes = Math.floor(totalSeconds/60);\r\n const totalHours = Math.floor(totalMinutes/60);\r\n const totalDays = Math.floor(totalHours/24);\r\n\r\n const hours = totalHours - ( totalDays * 24 );\r\n const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );\r\n const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );\r\n\r\n if(totalDays == 0){\r\n if(start.getDate() == new Date().getDate()){\r\n let time = start.getHours() + \":\" + addZero(start.getUTCMinutes());\r\n return time;\r\n }\r\n else{\r\n return 'Ontem';\r\n }\r\n }\r\n else{\r\n let date = addZero(start.getDate()) + \"/\" + addZero(start.getMonth()+1) + \"/\" + start.getFullYear();\r\n return date;\r\n }\r\n}\r\n\r\nmodule.exports = {\r\n showDateDuration: showDateDuration\r\n};"],"mappings":"AACA,SAASA,OAAOA,CAACC,CAAC,EAAE;EAClB,IAAIA,CAAC,GAAG,EAAE,EAAE;IACVA,CAAC,GAAG,GAAG,GAAGA,CAAC;EACb;EACA,OAAOA,CAAC;AACV;AAEA,SAASC,gBAAgBA,CAACC,KAAK,EAAE;EAC7B,IAAIC,GAAG;EACPA,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;EAChBF,KAAK,GAAG,IAAIE,IAAI,CAACF,KAAK,CAAC;EACvB,IAAIG,cAAc;EAGlB,MAAMC,YAAY,GAAOC,IAAI,CAACC,KAAK,CAAC,CAACL,GAAG,GAAID,KAAM,IAAE,IAAI,CAAC;EAAC;EAC1D,MAAMO,YAAY,GAAOF,IAAI,CAACC,KAAK,CAACF,YAAY,GAAC,EAAE,CAAC;EACpD,MAAMI,UAAU,GAASH,IAAI,CAACC,KAAK,CAACC,YAAY,GAAC,EAAE,CAAC;EACpD,MAAME,SAAS,GAAUJ,IAAI,CAACC,KAAK,CAACE,UAAU,GAAC,EAAE,CAAC;EAElD,MAAME,KAAK,GAAKF,UAAU,GAAKC,SAAS,GAAG,EAAI;EAC/C,MAAME,OAAO,GAAGJ,YAAY,GAAKE,SAAS,GAAG,EAAE,GAAG,EAAI,GAAKC,KAAK,GAAG,EAAI;EACvE,MAAME,OAAO,GAAGR,YAAY,GAAKK,SAAS,GAAG,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