from helloflask.views import app
from datetime import datetime, date


# fiters


@app.template_filter('ymd2')               
def datetime_ymd2(dt):
    dat = datetime.strptime(dt, '%Y%m%d')
    
    return dat.strftime('%Y.%m.%d')
    

@app.template_filter('ymd')               
def datetime_ymd(dt, fmt='%m-%d'):
    if isinstance(dt, date):
        return "<strong>%s</strong>" % dt.strftime(fmt)
    else:
        return dt


@app.template_filter('simpledate')
def simpledate(dt):
    if not isinstance(dt, date):
        dt = datetime.strptime(dt, '%Y-%m-%d %H:%M')

    if (datetime.now() - dt).days < 1:
        fmt = "%H:%M"
    else:
        fmt = "%m/%d"

    return "<strong>%s</strong>" % dt.strftime(fmt)

61f978e003244b2c87cbd77189e8cdc485284c04
<mask token>


@app.template_filter('ymd2')
def datetime_ymd2(dt):
    dat = datetime.strptime(dt, '%Y%m%d')
    return dat.strftime('%Y.%m.%d')


<mask token>

<mask token>


@app.template_filter('ymd2')
def datetime_ymd2(dt):
    dat = datetime.strptime(dt, '%Y%m%d')
    return dat.strftime('%Y.%m.%d')


<mask token>


@app.template_filter('simpledate')
def simpledate(dt):
    if not isinstance(dt, date):
        dt = datetime.strptime(dt, '%Y-%m-%d %H:%M')
    if (datetime.now() - dt).days < 1:
        fmt = '%H:%M'
    else:
        fmt = '%m/%d'
    return '<strong>%s</strong>' % dt.strftime(fmt)

<mask token>


@app.template_filter('ymd2')
def datetime_ymd2(dt):
    dat = datetime.strptime(dt, '%Y%m%d')
    return dat.strftime('%Y.%m.%d')


@app.template_filter('ymd')
def datetime_ymd(dt, fmt='%m-%d'):
    if isinstance(dt, date):
        return '<strong>%s</strong>' % dt.strftime(fmt)
    else:
        return dt


@app.template_filter('simpledate')
def simpledate(dt):
    if not isinstance(dt, date):
        dt = datetime.strptime(dt, '%Y-%m-%d %H:%M')
    if (datetime.now() - dt).days < 1:
        fmt = '%H:%M'
    else:
        fmt = '%m/%d'
    return '<strong>%s</strong>' % dt.strftime(fmt)

from helloflask.views import app
from datetime import datetime, date


@app.template_filter('ymd2')
def datetime_ymd2(dt):
    dat = datetime.strptime(dt, '%Y%m%d')
    return dat.strftime('%Y.%m.%d')


@app.template_filter('ymd')
def datetime_ymd(dt, fmt='%m-%d'):
    if isinstance(dt, date):
        return '<strong>%s</strong>' % dt.strftime(fmt)
    else:
        return dt


@app.template_filter('simpledate')
def simpledate(dt):
    if not isinstance(dt, date):
        dt = datetime.strptime(dt, '%Y-%m-%d %H:%M')
    if (datetime.now() - dt).days < 1:
        fmt = '%H:%M'
    else:
        fmt = '%m/%d'
    return '<strong>%s</strong>' % dt.strftime(fmt)

from helloflask.views import app
from datetime import datetime, date


# fiters


@app.template_filter('ymd2')               
def datetime_ymd2(dt):
    dat = datetime.strptime(dt, '%Y%m%d')
    
    return dat.strftime('%Y.%m.%d')
    

@app.template_filter('ymd')               
def datetime_ymd(dt, fmt='%m-%d'):
    if isinstance(dt, date):
        return "<strong>%s</strong>" % dt.strftime(fmt)
    else:
        return dt


@app.template_filter('simpledate')
def simpledate(dt):
    if not isinstance(dt, date):
        dt = datetime.strptime(dt, '%Y-%m-%d %H:%M')

    if (datetime.now() - dt).days < 1:
        fmt = "%H:%M"
    else:
        fmt = "%m/%d"

    return "<strong>%s</strong>" % dt.strftime(fmt)
