-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
A config setting for invalid date message #229
Comments
You can configure it to accept empty dates to avoid the Invalid Date output: As for configuring the error message, "Invalid Date," that's handled internally within momentjs and I don't know off the top of my head if their is an API to configure it. That said, I'd be happy to accept a pull request |
I've already configured |
@musaffa do you know what the value (empty string, null, or an invalid date string, etc.) you are passing into the helper is? Which helper are you using? |
I'm using This answer in SO suggests using moment.updateLocale(moment.locale(), { invalidDate: "empty date" }) |
@musaffa Assuming you are on the latest version, I'd expect that to snippet to still work with ember-moment. |
I tried but it didn't work. |
@musaffa ember-cli-moment-shim (the thing you import I would defer to opening an issue within momentjs if you need first-class support for changing this string. |
A feature request.
Currently, if the date is invalid the template helper outputs
Invalid date
. The users might think there's something wrong in the data but if it is perfectly to valid to have empty dates. It is perhaps more desirable to display an empty""
orempty date
message to the user instead of showingInvalid date
. If there were a config option (global and local) to set a message which overrides thisInvalid date
message, this could have been easily solved. So if I setempty date
in that config setting, thisempty date
message will show up instead ofInvalid date
.Thanks.
The text was updated successfully, but these errors were encountered: