Skip to content

A drop-in replacement for the "date" django templatetag. The only difference is that it shows Thai years, not Gregorian calendar ones.

License

Notifications You must be signed in to change notification settings

joncombe/django-thaidate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-thaidate

A drop-in replacement for the "date" django templatetag. The only difference is that it shows Thai years, not Gregorian calendar ones.

Installation

  • pip install django-thaidate
  • Add thaidate to INSTALLED_APPS in settings.py

Usage

{% load thaidate %}

{{ value|date:"D d M Y" }}  # อา. 10 ก.พ. 2019
{{ value|thaidate:"D d M Y" }}  # อา. 10 ก.พ. 2562

A reminder to self

Are you trying to show a Thai date on a page rendered with another language? Use the built-in language flag:

{% load i18n thaidate %}

{% language 'th' %}
{{ value|date:"D d M Y" }}  # อา. 10 ก.พ. 2019
{{ value|thaidate:"D d M Y" }}  # อา. 10 ก.พ. 2562
{% endlanguage %}

About

A drop-in replacement for the "date" django templatetag. The only difference is that it shows Thai years, not Gregorian calendar ones.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages