question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: when given empty string it should output an error message that is customizable.

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
brockpetriecommented, Mar 21, 2017

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.

0reactions
brockpetriecommented, Nov 18, 2017

v3.0.0 via #53 now uses this behavior. Thanks @BrockReece for the fix and @thegreyfellow for the suggestion!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found