Files
daily-counter/app/enums.py
John Ahlroos da7e881311
Some checks failed
Build & Release / build-docker-image (push) Failing after 3m15s
Build & Release / deploy-to-production (push) Has been skipped
Initial import
2026-04-06 20:32:01 +02:00

40 lines
990 B
Python

from enum import IntEnum, Enum
class CounterType(IntEnum):
SIMPLE = 1
DAILY = 2
WEEKLY = 3
MONTHLY = 4
YEARLY = 5
def current_unit_text(self):
match self:
case CounterType.DAILY:
return 'today'
case CounterType.WEEKLY:
return 'this week'
case CounterType.MONTHLY:
return 'this month'
case CounterType.YEARLY:
return 'this year'
case _:
return 'times'
def previous_unit_text(self):
match self:
case CounterType.DAILY:
return 'yesterday'
case CounterType.WEEKLY:
return 'last week'
case CounterType.MONTHLY:
return 'last month'
case CounterType.YEARLY:
return 'last year'
case _:
return 'times'
class Tabs(Enum):
COUNTERS ="Counters"
STATISTICS = "Stats"