Browse Source

format age on homepage in hex

Thomas B 7 months ago
parent
commit
0466655231
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      macros.py

+ 3
- 1
macros.py View File

70
     return int(date_as_float(end_date) - date_as_float(start_date))
70
     return int(date_as_float(end_date) - date_as_float(start_date))
71
 
71
 
72
 def own_age():
72
 def own_age():
73
-    return difference_in_years(get_conf("birthday"), datetime.now())
73
+    age_dec = difference_in_years(get_conf("birthday"), datetime.now())
74
+    age_hex = '0x%X' % age_dec
75
+    return '<abbr title="' + str(age_dec) + '">' + str(age_hex) + '</abbr>'
74
 
76
 
75
 # -----------------------------------------------------------------------------
77
 # -----------------------------------------------------------------------------
76
 # sub page helper macro
78
 # sub page helper macro

Loading…
Cancel
Save