pyvikunja 0.5__tar.gz → 0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyvikunja
3
- Version: 0.5
3
+ Version: 0.6
4
4
  Summary: A Python wrapper for Vikunja API
5
5
  Author: Joseph Shufflebotham
6
6
  License: AGPL
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyvikunja"
7
- version = "0.5"
7
+ version = "0.6"
8
8
  description = "A Python wrapper for Vikunja API"
9
9
  authors = [
10
10
  {name = "Joseph Shufflebotham"}
@@ -1,4 +1,4 @@
1
- from datetime import datetime, timedelta
1
+ from datetime import datetime, timedelta, timezone
2
2
  from typing import Dict, Optional, List
3
3
 
4
4
  from pyvikunja.models.enum.repeat_mode import RepeatMode
@@ -72,17 +72,26 @@ class Task(BaseModel):
72
72
 
73
73
  async def set_due_date(self, date: datetime) -> 'Task':
74
74
  # Set the task's due date in ISO format
75
- iso_date = date.isoformat() + "Z"
75
+ if date.tzinfo is None:
76
+ date = date.replace(tzinfo=timezone.utc)
77
+
78
+ iso_date = str(date.isoformat())
76
79
  return await self.update({'due_date': iso_date})
77
80
 
78
81
  async def set_start_date(self, date: datetime) -> 'Task':
79
82
  # Set the task's start date in ISO format
80
- iso_date = date.isoformat() + "Z"
83
+ if date.tzinfo is None:
84
+ date = date.replace(tzinfo=timezone.utc)
85
+
86
+ iso_date = str(date.isoformat())
81
87
  return await self.update({'start_date': iso_date})
82
88
 
83
89
  async def set_end_date(self, date: datetime) -> 'Task':
84
90
  # Set the task's end date in ISO format
85
- iso_date = date.isoformat() + "Z"
91
+ if date.tzinfo is None:
92
+ date = date.replace(tzinfo=timezone.utc)
93
+
94
+ iso_date = str(date.isoformat())
86
95
  return await self.update({'end_date': iso_date})
87
96
 
88
97
  async def set_repeating_interval(self, interval: timedelta, mode: RepeatMode = RepeatMode.DEFAULT) -> 'Task':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pyvikunja
3
- Version: 0.5
3
+ Version: 0.6
4
4
  Summary: A Python wrapper for Vikunja API
5
5
  Author: Joseph Shufflebotham
6
6
  License: AGPL
File without changes
File without changes
File without changes
File without changes
File without changes