You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
604 B

1 week ago
import json
import os
import uuid
from datetime import datetime, timedelta
from constants import Constants
from logging import logger
def get_ordinal(n):
if 10 <= n % 100 <= 20:
suffix = 'th'
else:
suffix = {1: 'st', 2: 'nd', 3: 'rd'}.get(n % 10, 'th')
return str(n) + suffix
def get_today():
now = datetime.now()
return now.strftime("%a, %b %d, %Y")
def get_sunday():
now = datetime.now()
sunday = now - timedelta(days=now.weekday()) - timedelta(days=1)
return sunday.strftime("%a, %b %d, %Y")
def generate_uuid():
return str(uuid.uuid4())