Conversation
The Expiration is often compared using the day numbers. It was now replaced to compare with the dates itself.
Owner
|
Hi @Ajay-006 ! By simply instantiating a So then, two dates will only be equal if they happened in the same date, up to the same second! |
Author
|
Thank you for your response. It inspiring me to make more such
contributions.
…On Sat, Jun 26, 2021, 9:28 PM Stoian Dan ***@***.***> wrote:
Hi @Ajay-006 <https://github.com/Ajay-006> !
You're welcome to contribute, thank you for your interest!
Your fix is almost done, but you need to change something.
By simply instantiating a new Date(), it will give you the date and time,
with hours, minutes and seconds (yes, it's called Date, a bit confusing).
You can check it out in the console:
[image: image]
<https://user-images.githubusercontent.com/10388612/123518751-061bb780-d6b0-11eb-9a38-0a757f09b7d4.png>
So then, two dates will only be equal if they happened in the same date,
up to the same second!
What you want to do is after instantiating a new Date(), is to call the
toLocaleDateString(), this will only yield the "date" as in 26/06/2021.
Also, would you be kind enough to rename the global varriable to
currentDate and the local const to dateNow? I think those will be better
names
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQU6HRNA6MS4SH3J2AG5FNTTUX2JFANCNFSM47LNGPNA>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The Expiration is often compared using the day numbers. It was now replaced to compare with the dates itself.