from django import template
from babel.dates import format_date
register = template.Library()


@register.filter
def preaddr(value, arg):
    addr = ''
    if value:
        addr = '%s%s' % (arg, value)
    return addr


@register.filter
def thaidate(value):
    dm = format_date(value, 'd MMM', locale='th_TH')
    y = value.year + 543
    return '%s %s' % (dm, y)

55ca3268ec88226cc2d3d7ea45f70045a36f7c87
<mask token>


@register.filter
def preaddr(value, arg):
    addr = ''
    if value:
        addr = '%s%s' % (arg, value)
    return addr


<mask token>

<mask token>


@register.filter
def preaddr(value, arg):
    addr = ''
    if value:
        addr = '%s%s' % (arg, value)
    return addr


@register.filter
def thaidate(value):
    dm = format_date(value, 'd MMM', locale='th_TH')
    y = value.year + 543
    return '%s %s' % (dm, y)

<mask token>
register = template.Library()


@register.filter
def preaddr(value, arg):
    addr = ''
    if value:
        addr = '%s%s' % (arg, value)
    return addr


@register.filter
def thaidate(value):
    dm = format_date(value, 'd MMM', locale='th_TH')
    y = value.year + 543
    return '%s %s' % (dm, y)

from django import template
from babel.dates import format_date
register = template.Library()


@register.filter
def preaddr(value, arg):
    addr = ''
    if value:
        addr = '%s%s' % (arg, value)
    return addr


@register.filter
def thaidate(value):
    dm = format_date(value, 'd MMM', locale='th_TH')
    y = value.year + 543
    return '%s %s' % (dm, y)
