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

Function is it right time #349

Closed
wants to merge 12 commits into from

Conversation

pjap93
Copy link
Contributor

@pjap93 pjap93 commented May 10, 2018

function isItRightTime.

Valide if the time is in the range definided.
For the addition in the conditions of the scenarios.

@pjap93 pjap93 changed the title Pjap93 time isitrighttime Time isitrighttime May 10, 2018
@pjap93 pjap93 changed the title Time isitrighttime Time is it right time May 10, 2018
@pjap93 pjap93 changed the title Time is it right time Function is it right time May 10, 2018
@pjap93 pjap93 closed this May 11, 2018
@pjap93 pjap93 reopened this May 11, 2018
@Pierre-Gilles
Copy link
Contributor

Hey! Is it ready for merge ? :) What's your use case on this ?

@pjap93
Copy link
Contributor Author

pjap93 commented May 12, 2018

Hi,
it is close if there is no error, but it is impossible to understand what is causing problems with Travis lol, even by putting the test file on it.
When I read the details of the error it indicates that the function does not exist while I declare everything (well I think).

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.

@MathieuAndrade
Copy link
Member

Use Promise.resolve(true) and Promise.resolve(false) instead of just returning a boolean ;)

@pjap93
Copy link
Contributor Author

pjap93 commented May 12, 2018

is good, thanks

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a 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

// settings default options if not defined
options = options || {};
options.start = date;
options.end = endDate;
Copy link
Contributor

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!

Copy link
Contributor Author

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

Copy link
Contributor

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 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is done :-)

var arrayOfEnd = options.end.split(":");

// default start time 00:00:00
var date = new Date();
Copy link
Contributor

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

Copy link
Contributor Author

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

@pjap93
Copy link
Contributor Author

pjap93 commented May 23, 2018

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
@Pierre-Gilles
Copy link
Contributor

It's now merged! :)

I just renamed the function "isInTimeRange" because your old function name was clearly not explicit.

Thanks for your work!

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

Successfully merging this pull request may close these issues.

3 participants