]> BookStack Code Mirror - bookstack/blob - resources/js/services/dates.ts
Merge pull request #5627 from BookStackApp/lexical_20250525
[bookstack] / resources / js / services / dates.ts
1 export function getCurrentDay(): string {
2     const date = new Date();
3     const month = date.getMonth() + 1;
4     const day = date.getDate();
5
6     return `${date.getFullYear()}-${(month > 9 ? '' : '0') + month}-${(day > 9 ? '' : '0') + day}`;
7 }
8
9 export function utcTimeStampToLocalTime(timestamp: number): string {
10     const date = new Date(timestamp * 1000);
11     const hours = date.getHours();
12     const mins = date.getMinutes();
13     return `${(hours > 9 ? '' : '0') + hours}:${(mins > 9 ? '' : '0') + mins}`;
14 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.