mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 10:47:35 -05:00
18 lines
361 B
Python
18 lines
361 B
Python
from datetime import datetime as dt
|
|
|
|
|
|
def format_date(dt_, fmt="%m/%d/%Y, %H:%M:%S"):
|
|
return f"{dt_:{fmt}}"
|
|
|
|
|
|
def now(fmt="%m/%d/%Y, %H:%M:%S"):
|
|
return format_date(dt.now(), fmt)
|
|
|
|
|
|
def remove_class(element, class_name):
|
|
element.element.classList.remove(class_name)
|
|
|
|
|
|
def add_class(element, class_name):
|
|
element.element.classList.add(class_name)
|