Skip to content
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

added type support for passing date as a number #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Apr 3, 2019

  1. added type support for passing date as a number

    the ? condition seems redundant, but needed for typescript type guard to work. otherwise (at least in TS 2.7.2) it doesn't know to pick the right Date constructor based on the type of value 
    
    This fix is needed for IDEs to not complain about type mismatch, e.g. in cases such as 
    
    `{{ item.modifiedDate | timeAgo }}`
    
    in case modified date is a number. 
    
    It works in practice because Date has a constructor that accepts number (milliseconds time stamp), but some IDEAs will complain about the pipe accepting only strings where the attribute is a number.
    eranation authored Apr 3, 2019
    Configuration menu
    Copy the full SHA
    2c2cd46 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    771ae22 View commit details
    Browse the repository at this point in the history