1
0
mirror of https://github.com/pyscript/pyscript.git synced 2022-05-01 19:47:48 +03:00

add utils to examples

This commit is contained in:
Fabio Pliger
2022-04-13 14:47:33 -05:00
parent 63d79840bc
commit 4b2dc2b57f

View File

@@ -0,0 +1,13 @@
from datetime import datetime as dt
def format_date(dt_, fmt = "%m/%d/%Y, %H:%M:%S"):
return dt_.strftime(fmt)
def now(fmt = "%m/%d/%Y, %H:%M:%S"):
return format_date(dt.now(), fmt)
def remove_class(element, className):
element.element.classList.remove("line-through")
def add_class(element, className):
element.element.classList.add("line-through")