From: Julien S. <Jul...@lr...> - 2004-10-29 14:31:26
|
> On Fri, Oct 29, 2004 at 03:38:36PM +0200, Julien Signoles wrote: > > (a) those dealing with the "business week"; > > (b) nth_weekday_of_month; > > (c) the optional parameter ?month of days_in_year. > > But (b) and (c) will be available in the next release of calendar (soon !). > > At this day, I don't understand what is a "business week" :-(. > > Business weeks are vital for me. They're the whole reason I ported > Date::Calc in the first place. ok. I've seen again what is the business week and now I understand it :-). With GregorianDate, you have: # business_of_standard (2004, 12, 31);; - : (int * int) * int = ((2004, 53), 5) # business_of_standard (2003, 12, 31);; - : (int * int) * int = ((2004, 1), 3) With the module Date of calendar, you have: # let business_of_standard d = week d, day_of_week d;; val business_of_standard : Date.t -> int * Date.day = <fun> # business_of_standard (make 2004 12 31);; - : int * Date.day = (53, Fri) # business_of_standard (make 2003 12 31);; - : int * Date.day = (1, Wed) In my opinion, it is the same except that my version does not return the year. But it is possible to deduce it from the month and the week if necessary. Of course, it is possible to convert a Date.day value to an int (and conversely): # int_of_day Fri;; - : int = 5 So I think I have no functionality to add in calendar in order to deal with the business week but, please, tell me if I miss something. Julien -- mailto:Jul...@lr... ; http://www.lri.fr/~signoles "In theory, practice and theory are the same, but in practice they are different" (Larry McVoy) |