pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pdf-devel] Re: Calendar spans


From: jemarch
Subject: [pdf-devel] Re: Calendar spans
Date: Tue, 13 May 2008 19:39:30 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (powerpc-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi Aleks.

   I have some questions regarding Calendar Spans in the Time Module:

   pdf_status_t
   pdf_time_add_cal_span (pdf_time_t object,
                           const struct pdf_time_cal_span_s cal_span)

   In the function `pdf_time_add_cal_span', the idea is to add to a given 
   pdf_time_t (stored internally in seconds since Unix timescale origin), a 
   given time span stored in a calendar way (years, months, days, and so 
   on). The thing is... this calendar span should be referred to a given 
   time origin, as the number of seconds in a year or in a month really 
   depends on the year or the month...

The base date to resolve the span should be the specified point of
time contained in OBJECT (would be better to name it TIME_OBJECT). In
other case the function doesnt have sense at all! This should be
documented in the Refman. entry for the function.

   pdf_status_t
   pdf_time_diff_cal (const pdf_time_t time1,
                       const pdf_time_t time2,
                       struct pdf_time_cal_span_s *p_cal_span);

   And another one: Time spans represented in calendar way can't be 
   negative 
   (http://lists.gnu.org/archive/html/pdf-devel/2008-04/msg00017.html). So 
   in functions like `pdf_time_diff_cal', how can be detected which is the 
   time variable which is used as time origin for the calendar span 
   returned? I can't say for example that the origin is always the first 
   time variable passed.

Hmm. Maybe would be a good idea to reinsert the `sign' attribute in
the cal time spans: `pdf_time_span_t' can be negative, and the idea
behind calendar time spans is to reflect the semantics of the opaque
`pdf_time_span_t' in a human-friendly way.

   BTW, is it really necessary/useful a time span stored in calendar way, 
   taking into account that it must be referred to a given time origin?

In fact I think that they are really useful for work with
date-relative time spans. A year is conceptually only one year
regardless the number of days it is composed of, and "users" like to
speak in months and years :)

-- 
Jose E. Marchesi  <address@hidden>
                  <address@hidden>

GNU Spain         http://es.gnu.org
GNU Project       http://www.gnu.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]