Closed TuSKan closed 5 years ago
Here you go.
Wow!!!! Thank you very much for being so blazing fast to do this new feature. I really appreciate that!
I don't know what I miss here, but don't work for me.
This works fine
from objectpath.utils.timeutils import dateTime
dateTime(["1980-05-11 04:22:33", "%Y-%m-%d %H:%M:%S"])
But this don't work, return NoneType
from objectpath import *
Tree({}).execute('dateTime(["1980-05-11 04:22:33", "%Y-%m-%d %H:%M:%S"])')
dateTime("1980-05-11 04:22:33", "%Y-%m-%d %H:%M:%S")
Greetings, Adrian Kalbarczyk
ᐧ
On Tue, Dec 4, 2018 at 11:45 PM Rener Castro notifications@github.com wrote:
I don't know what I miss here, but don't work for me.
This works fine
from objectpath.utils.timeutils import dateTime dateTime(["1980-05-11 04:22:33", "%Y-%m-%d %H:%M:%S"])
But this don't work, return NoneType
from objectpath import * Tree({}).execute('dateTime(["1980-05-11 04:22:33", "%Y-%m-%d %H:%M:%S"])')
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/issues/79#issuecomment-444288629, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKycnBJqFhIsKYvo3n9dOG9W5bAvdaxks5u1vsdgaJpZM4Y_kx6 .
It works, Thank you very much!!!
In ObjectPath/objectpath/utils/timeutils.py line 37 _years = round910(days/356) should not be 365 ?
def age(date, reference=None, lang="en"):
if reference is None:
reference = now()
td = reference - date #TimeDelta
days = float(td.days)
langIsPL = lang == "pl"
if days:
years = round9_10(days/356)
...
It should.
On Wed, 5 Dec 2018 at 02:55 Rener Castro notifications@github.com wrote:
In ObjectPath/objectpath/utils/timeutils.py line 37 years = round9_10(days/356) should not be 365 ?
def age(date, reference=None, lang="en"): if reference is None: reference = now() td = reference - date #TimeDelta
days = float(td.days) langIsPL = lang == "pl" if days: years = round9_10(days/356) ...
— You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub https://github.com/adriank/ObjectPath/issues/79#issuecomment-444329146, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKycmDQ2sf-6FySJrKKw9-Kzu1T22tdks5u1yeQgaJpZM4Y_kx6 .
-- Greetings, Adrian Kalbarczyk
Hi adrian, Thank you very much for building this awesome package.
I would like to calculate the age from the object below:
It's possible on functions on _ObjectPath/objectpath/utils/timeutils.p_y to accept strings, with adding a format parameter?