Skip to content

Commit

Permalink
aa
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxwheels committed May 31, 2022
1 parent eb881a2 commit de3fac0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/sticky-menu.css" rel="stylesheet">
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<py-env>
- paths:
- ./utils.py
</py-env>
</head>
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
Expand Down
17 changes: 17 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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, class_name):
element.element.classList.remove(class_name)


def add_class(element, class_name):
element.element.classList.add(class_name)

0 comments on commit de3fac0

Please sign in to comment.