-
Notifications
You must be signed in to change notification settings - Fork 418
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
Start with an empty input field #199
Comments
@johannesjo has suggested a much better option below, which does not require making changes to the lib. |
Had the same problem. You could also use a decorator: angular.module('yourModule')
.config(function ($provide)
{
$provide.decorator('mFormatFilter', function ()
{
return function newFilter(m, format, tz)
{
if (!(moment.isMoment(m))) {
return '';
}
return tz ? moment.tz(m, tz).format(format) : m.format(format);
};
});
}); |
Thanks guys I will give this a try. |
Great fix, decorator is a fantastic way of working. Thanks for your help. |
@DanTalash Thanks for sharing the correct line of code :) |
Hi this solutions when i want empty input but when i receive string date from service, input will be empty. For example when service give me '2016-02-03' string date, input field will be empty. |
Hi guys, I was looking for how to implement this decorator, do you have a plunker example? It's because in my case it's not working as expected. Thanks in advance. |
Would be fixed by PR https://github.com/g00fy-/angular-datepicker/pull/293 |
It's a great one but instead of Use (the first one return blank if tz is undefined) |
@johannesjo after I add your code I am getting this errror message - Error: [$injector:modulerr] Failed to instantiate module myModule due to: |
@chinmay they probably changed it in some way or the other. I'm afraid that you will have to check their code where and if to apply the decorator. |
thanks @johannesjo I have faced another issue. can you please see above link. When I will select any date each time I am getting previous date from the input date. I select |
@chinmay: you probably want to open a new issue. |
@johannesjo I have opened a new issue. Please go https://github.com/g00fy-/angular-datepicker/issues/320 |
Hi, Is there any way to start with an empty input field (not date pre-set), my field is not required and I would like a blank/empty input field to start with.
The text was updated successfully, but these errors were encountered: