flask-humanize icon indicating copy to clipboard operation
flask-humanize copied to clipboard

Make conda package

Open TejasAvinashShetty opened this issue 4 years ago • 1 comments

TejasAvinashShetty avatar Feb 20 '21 13:02 TejasAvinashShetty

Just for reference for anyone looking to use this package with conda - You can use the humanize package directly, which is on conda-forge: https://pypi.org/project/humanize/

I registered filters like this:

import humanize

@app.template_filter()
def naturalday(v):
    return humanize.naturalday(v)

@app.template_filter()
def naturaltime(v):
    return humanize.naturaltime(v)

Then you can use them in the template like this: {{ mydate | naturalday }}

prihoda avatar Aug 10 '21 08:08 prihoda