angular-datetime-range
angular-datetime-range copied to clipboard
Feature for null start/end dates
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.
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?
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.
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>
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
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?
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.