Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def start(name, workspace) -> None:

click.echo("Successfully started!")
click.echo(
f"DESC: {response.description}\tID: {response.id}\tSTART TIME: {datetime.strftime(response.start, '%d/%m/%Y, %H:%M:%S')}"
f"DESC: {response.description}\tID: {response.id}\tTIME: {datetime.strftime(response.start, '%Y-%m-%d %H:%M:%S')} - In process"
)


Expand All @@ -42,7 +42,7 @@ def stop(workspace, id) -> None:

click.echo("Successfully stopped!")
click.echo(
f"DESC: {response.description}\tID: {response.id}\tSTART TIME: {datetime.strftime(response.start, '%d/%m/%Y, %H:%M:%S')}\tEND TIME: {response.end}"
f"DESC: {response.description}\tID: {response.id}\tTIME: {datetime.strftime(response.start, '%Y-%m-%d %H:%M:%S')} - {response.end}"
)


Expand Down
8 changes: 6 additions & 2 deletions src/lib_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ class TimeEntry:
task_id: str | None = None
type_: TimeEntryType | None = None

def _transform_datetime_to_str(self, datetime_obj: datetime) -> str:
return datetime_obj.astimezone(UTC).strftime("%Y-%m-%dT%H:%M:%SZ")
def _transform_datetime_to_str(self, datetime_obj: datetime | None) -> str | None:
return (
None
if not datetime_obj
else datetime_obj.astimezone(UTC).strftime("%Y-%m-%dT%H:%M:%SZ")
)

def to_json(self) -> dict:
return {
Expand Down