Hi again,
It seems to me that the autodoc of the Calendar module is incorrect or there is a problem in the Calendar.Time* classes. The doc say you can use Calendar.TimeRange("unix", int unixtime) but when I try with either pike 7.5 or 7.2, I have:
Calendar.TimeRange("unix", time());
Calling undefined function. ISO.TimeRange: TimeRange()->create_unixtime_default(1080599245) /usr/local/pike/7.2.504/lib/modules/Calendar.pmod/TimeRanges.pmod:81: TimeRange()->create("unix",1080599245)
ISO: ISO->TimeRange() -:1: ___Foo4711()
Calendar.TimeRange("unix", time());
Calling undefined function. ISO.TimeRange: TimeRange()->create_unixtime_default(1080599068) /usr/local/pike/7.5.23/lib/modules/Calendar.pmod/TimeRanges.pmod:78: TimeRange()->create("unix",1080599068)
/usr/local/pike/7.5.23/lib/modules/Calendar.pmod/TimeRanges.pmod:11: ISO->TimeRange()
HilfeInput:1: HilfeInput()->___HilfeWrapper()
There is the same problem with Calendar.Time.TimeofDay. When looking at the code it seems indeed that the create_unixtime_default function is not defined in either TimeRange nor TimeofDay classes but defined in clases that inherited these one. So I wonder if the doc lie or if the code is wrong ?
I also changed the doc for http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/Calendar/Time...,
replacing "unixtime" by "unix".
/ David
David Gourdelier wrote:
Hi again,
It seems to me that the autodoc of the Calendar module is incorrect or there is a problem in the Calendar.Time* classes. The doc say you can use Calendar.TimeRange("unix", int unixtime) but when I try with either pike 7.5 or 7.2, I have:
BTW can you change the install script not dump modules for Calendar.pmod ? Maybe it's not the best solution but since you can't use lot of the things inside Calendar.pmod without rm'ing the .o inside, I think it's a good one for now.
/ David
What are you trying to do? Get time objects of second precision, for present time (or any time() reading)? That would be accomplished with Calendar.Second(), or Calendar.Second( time() ), if you wanted some specific time from a seconds-since-the-epoch integer.
I think the only Calendar methods you would want to pass strings to (in their exposed API) are the various parsing methods (parse, dwim_*, and possibly some other one as well). Calendar is eagerly awaiting a docs hero; anyone could fill the void, asking around for how to do particular operations and record the answers in appropriate refdocs.
/ Johan Sundström (Achtung Liebe!)
Previous text:
2004-03-30 00:35: Subject: Calendar question
Hi again,
It seems to me that the autodoc of the Calendar module is incorrect or there is a problem in the Calendar.Time* classes. The doc say you can use Calendar.TimeRange("unix", int unixtime) but when I try with either pike 7.5 or 7.2, I have:
Calendar.TimeRange("unix", time());
Calling undefined function. ISO.TimeRange: TimeRange()->create_unixtime_default(1080599245) /usr/local/pike/7.2.504/lib/modules/Calendar.pmod/TimeRanges.pmod:81: TimeRange()->create("unix",1080599245)
ISO: ISO->TimeRange() -:1: ___Foo4711()
Calendar.TimeRange("unix", time());
Calling undefined function. ISO.TimeRange: TimeRange()->create_unixtime_default(1080599068) /usr/local/pike/7.5.23/lib/modules/Calendar.pmod/TimeRanges.pmod:78: TimeRange()->create("unix",1080599068)
/usr/local/pike/7.5.23/lib/modules/Calendar.pmod/TimeRanges.pmod:11: ISO->TimeRange()
HilfeInput:1: HilfeInput()->___HilfeWrapper()
There is the same problem with Calendar.Time.TimeofDay. When looking at the code it seems indeed that the create_unixtime_default function is not defined in either TimeRange nor TimeofDay classes but defined in clases that inherited these one. So I wonder if the doc lie or if the code is wrong ?
I also changed the doc for http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/Calendar/Time...,
replacing "unixtime" by "unix".
/ David
/ Brevbäraren
TimeRange is a base class, not something you can clone.
Clone something that inherits TimeRange, for instance Day or Second, or implement your own class inheriting TimeRange.
/ Mirar
Previous text:
2004-03-30 00:35: Subject: Calendar question
Hi again,
It seems to me that the autodoc of the Calendar module is incorrect or there is a problem in the Calendar.Time* classes. The doc say you can use Calendar.TimeRange("unix", int unixtime) but when I try with either pike 7.5 or 7.2, I have:
Calendar.TimeRange("unix", time());
Calling undefined function. ISO.TimeRange: TimeRange()->create_unixtime_default(1080599245) /usr/local/pike/7.2.504/lib/modules/Calendar.pmod/TimeRanges.pmod:81: TimeRange()->create("unix",1080599245)
ISO: ISO->TimeRange() -:1: ___Foo4711()
Calendar.TimeRange("unix", time());
Calling undefined function. ISO.TimeRange: TimeRange()->create_unixtime_default(1080599068) /usr/local/pike/7.5.23/lib/modules/Calendar.pmod/TimeRanges.pmod:78: TimeRange()->create("unix",1080599068)
/usr/local/pike/7.5.23/lib/modules/Calendar.pmod/TimeRanges.pmod:11: ISO->TimeRange()
HilfeInput:1: HilfeInput()->___HilfeWrapper()
There is the same problem with Calendar.Time.TimeofDay. When looking at the code it seems indeed that the create_unixtime_default function is not defined in either TimeRange nor TimeofDay classes but defined in clases that inherited these one. So I wonder if the doc lie or if the code is wrong ?
I also changed the doc for http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/Calendar/Time...,
replacing "unixtime" by "unix".
/ David
/ Brevbäraren
pike-devel@lists.lysator.liu.se