1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-21 12:29:36 +02:00

Added option to change date formatting. Added shortcuts to clear search bar

This commit is contained in:
Paweł Malak 2021-10-22 15:51:11 +02:00
parent cfb471e578
commit 4ef9652ede
11 changed files with 68 additions and 13 deletions

View file

@ -1,8 +1,39 @@
export const dateTime = (): string => {
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
const days = [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
];
const months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
];
const now = new Date();
return `${days[now.getDay()]}, ${now.getDate()} ${months[now.getMonth()]} ${now.getFullYear()}`;
}
const useAmericanDate = localStorage.useAmericanDate === 'true';
if (!useAmericanDate) {
return `${days[now.getDay()]}, ${now.getDate()} ${
months[now.getMonth()]
} ${now.getFullYear()}`;
} else {
return `${days[now.getDay()]}, ${
months[now.getMonth()]
} ${now.getDate()} ${now.getFullYear()}`;
}
};