-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Function is it right time #349
Conversation
Test si c'est la bonne heure
ajout de la fonction isItRightTime
Hey! Is it ready for merge ? :) What's your use case on this ? |
Hi, I currently use it under scenario conditions to set a validation time range. I would then make a PR in the data to add the condition if this is ok for you. |
Use |
is good, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey ! Thanks for your PR, this is really nice :)
I'm merging this just after these two changes in this review
api/core/time/time.isItRightTime.js
Outdated
// settings default options if not defined | ||
options = options || {}; | ||
options.start = date; | ||
options.end = endDate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these 3 lines useful ? I don't think so!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes well seen, I forget to remove them, initially I wanted to return data after I change a true / false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! Waiting for your review before merging :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is done :-)
api/core/time/time.isItRightTime.js
Outdated
var arrayOfEnd = options.end.split(":"); | ||
|
||
// default start time 00:00:00 | ||
var date = new Date(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider renaming the variable to "startDate", more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not my part that I prefer to give explicit names to variables lol
but you already noticed
and in the stride I can add in the base the condition for the scenarios !! |
changing the variable name to startDate and removing unnecessary functions
It's now merged! :) I just renamed the function "isInTimeRange" because your old function name was clearly not explicit. Thanks for your work! |
function isItRightTime.
Valide if the time is in the range definided.
For the addition in the conditions of the scenarios.