unclassified dates
This commit is contained in:
parent
83ae35006b
commit
be682f4754
10
src/tt/constants.py
Normal file
10
src/tt/constants.py
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
SPECIAL_DATES_PIECES = {
|
||||
"future": (3000,1,1),
|
||||
"unclassified": (1999,1,1),
|
||||
}
|
||||
SPECIAL_DATES_DISPLAY = {
|
||||
"3000-01-01": "[#333333]future[/]",
|
||||
"1999-01-01": "[#cccccc]unclassified[/]",
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ from peewee import fn
|
||||
from peewee import Case, Value
|
||||
from ..db import db, Task, SavedSearch
|
||||
from .. import config
|
||||
|
||||
from ..constants import SPECIAL_DATES_PIECES
|
||||
|
||||
|
||||
def get_task(item_id: int) -> Task:
|
||||
@ -14,7 +14,7 @@ def get_task(item_id: int) -> Task:
|
||||
def add_task(
|
||||
text: str,
|
||||
status: str,
|
||||
due: datetime | None = None,
|
||||
due: datetime | str = SPECIAL_DATES_PIECES["unclassified"],
|
||||
type: str = "",
|
||||
project: str = "",
|
||||
) -> Task:
|
||||
|
@ -161,10 +161,10 @@ class DateModal(ModalScreen):
|
||||
(p)ast (t)oday (f)uture""", classes="hints")
|
||||
|
||||
def action_future(self):
|
||||
self.pieces = SPECIAL_DAYS_PIECES["future"]
|
||||
self.pieces = SPECIAL_DATES_PIECES["future"]
|
||||
|
||||
def action_unclassified(self):
|
||||
self.pieces = SPECIAL_DAYS_PIECES["unclassified"]
|
||||
self.pieces = SPECIAL_DATES_PIECES["unclassified"]
|
||||
|
||||
def action_today(self):
|
||||
today = datetime.date.today()
|
||||
|
Loading…
Reference in New Issue
Block a user