Feature request: when given empty string it should output an error message that is customizable.
See original GitHub issueHi there, first thanks for this library it works like a charm !! I just love using it instead of directly hooking momentJS to the project. the only drawback I can see is that when given an empty string as the date to filter it outputs the date of today and there is no way to check on a data if it’s empty or not before filtering it in vueJS.
So my proposition is adding a methods mixin so we can use the moment()
as a function if filters are not the solution the situation.
And thanks for your time.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Custom extraction does not work when the value is an empty ...
We're writing a custom field extraction where the value can be an empty string. The value is stored in an input field.
Read more >Why WebApi marks empty string as error in model state?
The problem is rooted in some magic code in ModelValidationNode, which creates model errors for null models even if corresponding parameter has default...
Read more >Video: Input and error messages - Microsoft Support
... you can create a message that appears when they select a cell. Or that shows an error message when a drop-down list...
Read more >Write error messages for your UI with validate - R Shiny
This article will show you how to craft “validation errors,” errors designed to lead your user through the UI of your Shiny app....
Read more >Use empty string, null or remove empty property in API request ...
And right there are: on a paper questionnaire, how could you distinguish between no answer given and an answer consisting of an empty...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is a smart idea. I feel like this is an instance where moment shouldn’t try to assume the nature of the input. If someone wants to filter the current date, they should pass in
Date.now()
or a variable representing it. If the date input is null, the filter should fail, or at least log a warning in console.v3.0.0 via #53 now uses this behavior. Thanks @BrockReece for the fix and @thegreyfellow for the suggestion!