Skip Menu |

This queue is for tickets about the Date-Calc CPAN distribution.

Report information
The Basics
Id: 48302
Status: resolved
Priority: 0/
Queue: Date-Calc

People
Owner: Nobody in particular
Requestors: frequency [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 5.4
Fixed in: (no value)



Subject: Feature Request: Add a way to set Saturday or Sunday as working days
Hi: This request comes from a Debian user in our bug tracking system and I'm forwarding the report upstream for your perusal. "There doesn't seem to be any way to make Saturday and/or Sunday into a work day. It'd be nice if the workdays were customizable; not everyone's work week is Monday–Friday." For the original report, see: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494736 Cheers, Jonathan
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #48302] Feature Request: Add a way to set Saturday or Sunday as working days
Date: Wed, 29 Jul 2009 21:40:35 +0200
To: Jonathan Yu via RT <bug-Date-Calc [...] rt.cpan.org>
From: Steffen Beyer <sb [...] engelschall.com>
Hello Jonathan Yu via RT, in a previous mail you wrote: Show quoted text
> Wed Jul 29 12:38:54 2009: Request 48302 was acted upon. > Transaction: Ticket created by FREQUENCY > Queue: Date-Calc > Subject: Feature Request: Add a way to set Saturday or Sunday as working days > Broken in: 5.4 > Severity: Wishlist > Owner: Nobody > Requestors: frequency@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48302 > > > > Hi: > > This request comes from a Debian user in our bug tracking system and I'm > forwarding the report upstream for your perusal. > > "There doesn't seem to be any way to make Saturday and/or Sunday into a > work day. It'd be nice if the workdays were customizable; not everyone's > work week is Monday???Friday." > > For the original report, see: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494736 > > Cheers, > Jonathan
Hi Jonathan, thanks for writing me! :-) Short answer: subclass Year.pm and override the "init" method. Caveat: How to make Calendar.pm call the subclass instead of Year.pm Long answer: I'll think about this problem! Sorry not to have a good answer right now... -- Steffen Beyer <sb@engelschall.com> http://www.engelschall.com/u/sb/whoami/ (Who am I) http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...) http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
Intermediate answer: See the attached file (calendar.cgi) for an example of how to do this. Hope this helps! Cheers, Steffen
Download calendar.cgi
application/octet-stream 26.5k

Message body not shown because it is not plain text.

This problem will be solved in the next version 5.7 of Date::Calc, to be released shortly.
On Fri Aug 21 17:24:15 2009, STBEY wrote: Show quoted text
> This problem will be solved in the next version 5.7 of Date::Calc, to be > released shortly.
You can already see it in action here: http://guest.engelschall.com/~sb/calendar/