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

Feature for null start/end dates #16

Open
amit777 opened this issue Jan 20, 2018 · 6 comments
Open

Feature for null start/end dates #16

amit777 opened this issue Jan 20, 2018 · 6 comments

Comments

@amit777
Copy link

amit777 commented Jan 20, 2018

Would it be possible to allow for null values for the start and ends dates. Null would indicate indefinite start or end. Kind of like infinity.

@g1eb
Copy link
Owner

g1eb commented Jan 21, 2018

Let me see if I understand you correctly, you want to have unset datetime objects before the user selects a date, right? Right now if the date is not set it's 'undefined' by default and shows a placeholder instead. What would be the displayed as a placeholder for a null value?

@amit777
Copy link
Author

amit777 commented Jan 21, 2018

oh, sorry, if it's undefined then that should work! I think I missed that. My goal is to let someone say "X starts on 2/2/18 and goes indefinitely". I could just create a button that sets either the start or end to undefined then.

@amit777
Copy link
Author

amit777 commented Jan 21, 2018

so if I tried to use the directive and both start and end are undefined, I am not able to click either the start or end date. I just see this:

<datetime-range start="item.start" end="item.end"></datetime-range>

screen shot 2018-01-21 at 3 48 52 pm

@amit777
Copy link
Author

amit777 commented Jan 21, 2018

If i set item.start to a new moment(0), then if I click the undefined item.end date, i get the following error in console:

TypeError: Cannot read property 'clone' of undefined
    at m.a.selectDate 

@g1eb
Copy link
Owner

g1eb commented Jan 22, 2018

Ahh, interesting... It seems like the start and end dates can not be undefined after all.
I think I was confused with the other angular datetime input directives that has placeholders..

Would you be able to use start and end datetime as separate directives from the other library or would you prefer adding placeholders and undefined range support here?

@stanglt
Copy link

stanglt commented Apr 26, 2018

I would highly appreciate such a feature in this one. With two of the other i still would have to encapsulate it to another directive to be have validations and so on.

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

3 participants