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.

How to handle null values ?

See original GitHub issue

Is theire a way to handle null values. {{date | amTimeAgo}} displays invalide date if date is null how customize that to something like --

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
melgishcommented, Mar 11, 2020

Why not copy the logic of the standard angular pipes when it comes to null values… https://github.com/angular/angular/blob/master/packages/common/src/pipes/date_pipe.ts

transform(value: any, format = 'mediumDate', timezone?: string, locale?: string): string|null {
    if (value == null || value === '' || value !== value) return null;

    try {
      return formatDate(value, format, locale || this.locale, timezone);
    } catch (error) {
      throw invalidPipeArgumentError(DatePipe, error.message);
    }
  }
1reaction
RouRcommented, Dec 23, 2018

{{someItem.dueToUtc ? (someItem.dueToUtc | amFromUtc | amLocal | amDateFormat:'LL') : 'your message'}}

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Tips for Dealing With Null Values | by Rashida Nasrin Sucky
6 Tips for Dealing With Null Values · 1. Simply Drop · 2. Filling with Zeros · 3. Forward and Backward Fill ·...
Read more >
5 Ways To Handle Missing Values In Machine Learning ...
1. Deleting Rows ... This method commonly used to handle the null values. Here, we either delete a particular row if it has...
Read more >
Handling null values - IBM
In an XML document, the usual way to represent a null value is to leave the element or attribute empty. For example, <price></price>...
Read more >
Handling MySQL NULL Values - Tutorialspoint
Handling NULL Values in a PHP Script ... You can use the if...else condition to prepare a query based on the NULL value....
Read more >
NULL Handling | CockroachDB Docs
NULL is the term used to represent a missing value. A NULL value in a table is a value in a field that...
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