-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OM-229 Fixed bill to mpay conversion
- Loading branch information
1 parent
01379c5
commit fea6131
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import re | ||
from datetime import datetime as py_datetime | ||
|
||
from core import datetime | ||
|
||
class SoapDatetime(datetime.datetime): | ||
def isoformat(self): | ||
return re.sub(r"[+-]00:?00$", "Z", self.strftime("%y-%m-%dT%H:%M:%S%z")) | ||
|
||
@classmethod | ||
def from_ad_date(cls, value): | ||
if value is None: | ||
return None | ||
return SoapDatetime(value.year, value.month, value.day, 0, 0, 0, 0, py_datetime.now().astimezone().tzinfo) | ||
|
||
@classmethod | ||
def from_ad_datetime(cls, value): | ||
if value is None: | ||
return None | ||
return SoapDatetime(value.year, value.month, value.day, | ||
value.hour, value.minute, value.second, value.microsecond, | ||
value.tzinfo or py_datetime.now().astimezone().tzinfo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters