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

Awesome books: with ES6 #2

Closed
Sparktan24 opened this issue Nov 8, 2022 · 1 comment
Closed

Awesome books: with ES6 #2

Sparktan24 opened this issue Nov 8, 2022 · 1 comment

Comments

@Sparktan24
Copy link

Good job so far! The project looks good.
There is a couple of details, to follow the ES6 best practices we should use arrow functions. And as an optional observation, maybe you can take advantage of the luxon library to save some code and use:

const dt = DateTime.now();
document.getElementById('yourHTMLID').innerHTML = dt.toLocaleString(DateTime.DATETIME_MED);
This should give you the actual date in the required format.

Cheers!

@fmanimashaun
Copy link
Owner

toLocaleString(DateTime.DATETIME_MED);

Actually, it will give you in the following format: 8 Nov 2022, 8:49 pm but based on the project requirements, we need to return the date and time in November 8th 2022, 8:51:2 PM See the image below:

Based on my research, luxon doesn't support putting st. nd, rd or th, I came across the following:

  1. support for n-th token? moment/luxon#118

Thus, luxon doesn't support it directly, thus, I had to improvise

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