Branch: Tag:

2006-01-17

2006-01-17 16:35:01 by Martin Bähr <mbaehr@email.archlab.tuwien.ac.at>

always use the more detailed information if available.
this fixes converting beginning() or end() of Day and larger to hours and lower where otherwise the beginning or end of the respecitive julian day is used which is at a fixed offset to UTC and not the same as normal days.

Rev: lib/modules/Calendar.pmod/TimeRanges.pmod:1.32

1:   //! module Calendar    - // $Id: TimeRanges.pmod,v 1.31 2006/01/13 15:57:20 grubba Exp $ + // $Id: TimeRanges.pmod,v 1.32 2006/01/17 16:35:01 mbaehr Exp $      #pike __REAL_VERSION__   
126:    static void convert_from(TimeRange other)    {   // inheriting class must take care of size -  if (other->julian_day) -  { -  int|float jd=other->julian_day(); -  if (floatp(jd) && other->unix_time) +  if (other->unix_time)    create("unix_r",other->unix_time(),other->ruleset()); -  +  else if (other->julian_day) +  create("julian_r",other->julian_day(),other->ruleset());    else -  create("julian_r",jd,other->ruleset()); -  } -  else if (other->unix_time) -  create("unix_r",other->unix_time(),other->ruleset()); -  else +     error("Can't convert %O->%s.%O\n",other,    calendar_name(), this_program);    }