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