rlv-dan/Snap2HTML

How do I fill a single-digit date with "0"?

Opened this issue · 1 comments

6665c7c75e6d1bfa0512be16

For example, 2022/5/2 is displayed as 2022/05/02, so that the dates can be aligned neatly and with the same width.

Find the following function in template.htmland change toLocaleString() to something that suits you better:

function timestampToDate(timestamp){
	// Convert UNIX timestamp to local date
	// If you don't like the date format, try something else, such as toLocaleDateString() manually formatting the date here
	return new Date(timestamp * 1000).toLocaleString();
}