Skip to content

Setting relativeTimeThresholdOptions object doesn't work #231

@Cthulahoop

Description

@Cthulahoop

Description of the Issue and Steps to Reproduce:

Did you search for duplicate issue? [Yes / no]

Please describe the issue and steps to reproduce, preferably with a code sample / plunker:

Adding the relativeTimeThresholdOptions object to the imports as shown in the Usage section of the readme doesn't change the moment relative time thresholds.

Demo

Please see StackBlitz demo here

Notes

  • The relativeTimeThresholdOptions object is set in app.module.ts and should set the ss threshold to 1 (so that seconds start showing nearly right away).
  • Checking the ss threshold value returns 44, which is the default (s == 45, ss == s - 1).
  • You can see the desired behavior by editing app.component.ts, uncommenting line 16.
    • Note that StackBlitz won't automatically reload moment if you comment line 16 out again, so reload the preview pane to be sure you see the changes.

The workaround is to set moment.relativeTimeThreshold manually, but this is kludgy.

Ensure your issue is isolated to ngx-moment. Issues involving third party tools will be closed unless submitted by the tool's author/maintainer.

Environment:

Please answer the following questions:

  • Angular version?
    ^8.0.0 & higher
  • TypeScript version?
    ~3.1.1
  • moment version?
    ^2.24.0
  • Are you using moment-timezone?
    no
  • Are you using the angular-cli?
    yes
  • Using Rollup/Webpack/System.js/Ionic/similar?
    n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions