|
|
@ -10,21 +10,20 @@ export function setDateTimeForTests(dateTime: string) {
|
|
|
|
mockDateTime = dateTime;
|
|
|
|
mockDateTime = dateTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function getDateTime() {
|
|
|
|
export const getDateTime = () => {
|
|
|
|
if (mockDateTime) {
|
|
|
|
if (mockDateTime) {
|
|
|
|
return mockDateTime;
|
|
|
|
return mockDateTime;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const date = new Date();
|
|
|
|
const date = new Date();
|
|
|
|
const year = date.getFullYear();
|
|
|
|
const year = date.getFullYear();
|
|
|
|
const month = date.getMonth() + 1;
|
|
|
|
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
|
|
const day = date.getDate();
|
|
|
|
const day = `${date.getDate()}`.padStart(2, "0");
|
|
|
|
const hr = date.getHours();
|
|
|
|
const hr = `${date.getHours()}`.padStart(2, "0");
|
|
|
|
const min = date.getMinutes();
|
|
|
|
const min = `${date.getMinutes()}`.padStart(2, "0");
|
|
|
|
const secs = date.getSeconds();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return `${year}${month}${day}${hr}${min}${secs}`;
|
|
|
|
return `${year}-${month}-${day}-${hr}${min}`;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export function capitalizeString(str: string) {
|
|
|
|
export function capitalizeString(str: string) {
|
|
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
|