Add grace period and fix bugs
This commit is contained in:
parent
e565c7be6d
commit
349e964364
14 changed files with 148 additions and 35 deletions
|
@ -1,18 +1,21 @@
|
|||
// Format time in "Jan 02, 2006" format
|
||||
function formatDate(date) {
|
||||
let dateFormat = new Intl.DateTimeFormat('en', {
|
||||
let dateFormat = new Intl.DateTimeFormat([langName, "en"], {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
})
|
||||
return dateFormat.format(Date.parse(date))
|
||||
return dateFormat.format(date)
|
||||
}
|
||||
|
||||
// Set today's date
|
||||
function updateDate() {
|
||||
let todayDate = new Date()
|
||||
let timeField = document.getElementById("today-date")
|
||||
timeField.innerText = formatDate(todayDate.toISOString().split('T')[0])
|
||||
if (graceActive) {
|
||||
let graceField = document.getElementById("grace")
|
||||
graceField.hidden = false
|
||||
}
|
||||
timeField.innerText = formatDate(Date.now())
|
||||
|
||||
}
|
||||
|
||||
|
|
22
public/manifest.json
Normal file
22
public/manifest.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"short_name": "Hibiscus",
|
||||
"name": "Hibiscus.txt",
|
||||
"description": "A plaintext diary",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/public/TODO.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
},
|
||||
{
|
||||
"src": "/public/favicon.ico",
|
||||
"type": "image/x-icon",
|
||||
"sizes": "16x16"
|
||||
}
|
||||
],
|
||||
"start_url": "/",
|
||||
"display": "minimal-ui",
|
||||
"scope": "/",
|
||||
"background_color": "#f5f0e1",
|
||||
"theme_color": "#f85552"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue