mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added ability to set own time format, GH-82
This commit is contained in:
parent
08cc32ac33
commit
d3e45b138b
@ -5,7 +5,7 @@ author = {
|
||||
"email":"maloja@dev.krateng.ch",
|
||||
"github": "krateng"
|
||||
}
|
||||
version = 2,12,11
|
||||
version = 2,12,12
|
||||
versionstr = ".".join(str(n) for n in version)
|
||||
links = {
|
||||
"pypi":"malojaserver",
|
||||
|
@ -85,6 +85,7 @@ DISCOURAGE_CPU_HEAVY_STATS = false
|
||||
|
||||
# Offset in hours to UTC
|
||||
TIMEZONE = 0
|
||||
TIME_FORMAT = "%d. %b %Y %I:%M %p" # use '%H:%M' instead of '%I:%M %p' for 24 hour clock
|
||||
|
||||
[Fluff]
|
||||
|
||||
|
@ -535,7 +535,8 @@ def timestamp_desc(t,short=False):
|
||||
return timeobject.strftime("%Y")
|
||||
else:
|
||||
timeobject = datetime.datetime.fromtimestamp(t,tz=TIMEZONE)
|
||||
return timeobject.strftime("%d. %b %Y %I:%M %p")
|
||||
format = get_settings("TIME_FORMAT")
|
||||
return timeobject.strftime(format)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user