Skip to content

Commit

Permalink
feat[construct]default value
Browse files Browse the repository at this point in the history
  • Loading branch information
serfend committed Feb 10, 2024
1 parent 4c8a6c3 commit 23de490
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions scidatetime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@ def __new__(
d = datetime.timedelta(seconds=-time_timezone)
tzinfo = datetime.timezone(d)

if year is Ellipsis:
year = 2000
if month is Ellipsis:
month = 1
if day is Ellipsis:
day = 1
if hour is Ellipsis:
hour = 0
if minute is Ellipsis:
minute = 0
if second is Ellipsis:
second = 0
if microsecond is Ellipsis:
microsecond = 0
if tzinfo is Ellipsis:
tzinfo = None

t = super().__new__(cls, year, month, day, hour, minute,
second, microsecond, tzinfo, fold=fold)
return t
Expand Down
2 changes: 1 addition & 1 deletion scidatetime/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__description__ = "scidatetime is python module for DateTime handle."
__keywords__ = ['lib', 'utils']
__url__ = "https://github.com/serfend/scidatetime"
__version__ = "1.19.15"
__version__ = "1.19.16"
__author__ = "serfend"
__author_email__ = "serfend@foxmail.com"
__license__ = "MIT Licence"
Expand Down

0 comments on commit 23de490

Please sign in to comment.