Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kidzgy opened this issue Jun 10, 2024 · 1 comment
Open

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

kidzgy opened this issue Jun 10, 2024 · 1 comment

Comments

@kidzgy
Copy link

kidzgy commented Jun 10, 2024

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.

@kidzgy kidzgy changed the title How do I fill a single-digit month with "0"? How do I fill a single-digit date with "0"? Jun 11, 2024
@rlv-dan
Copy link
Owner

rlv-dan commented Jun 14, 2024

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();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants