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:
13
pyscriptjs/examples/utils.py
Normal file
13
pyscriptjs/examples/utils.py
Normal 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")
|
||||
Reference in New Issue
Block a user