Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'd probably be willing to put set_day_of_week into DateTime.pm proper. I don't know about the sugar methods though.

    Regardless, DateTime::Weekdays probably isn't the right namespace. Please come discuss this on the datetime@perl.org list.
    • I know this is not the proper venue – I saw the pointer to the mailing list. I posted here instead of to the list because, well, I’d have to subscribe to the list, and then I’d be subscribed to yet another Perl list. I am on way too many of those already… I guess I should consolidate the mailboxes for the low-traffic lists and suck it up.

      Also, I know it’s not a good name. Don’t worry, I’m not putting this on CPAN quite yet. :-) That’s why I posted an RFC.

      I

      • I think set_day_of_week is a bad name and doesn't belong in the core of DateTime. The name doesn't really uniquely identify what the method does and implies several different inconsistent possibilities for its semantics.

        I think it'd be better if this functionality were wrapped in a DateTime::Set, which would give you the next and previous methods you are looking for. Maybe DateTime::Set::ByWeekday?

        --
        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • That sounds reasonable; I’m just not sure it makes sense. There is nothing of interest about the set as a whole: it’s no more than a set with weekly recurrence (and you can easily construct it that way if you do need such a set). The only property of interest is that 2 (or 3) specific members of the set are closest to a particular date.

          Also, I wanted to roll in a way to find the passed weekday that falls within the same week as the given date. To me there seems to be no reasonable way to conce

    • If this doesn't make it into DateTime proper, I'd rather it be a mixin that I could use just once and then all my datetime objects would behave thusly.
  • I hope I'm not starting a licensing flamewar here, but your licence section reads:

    This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L.

    Now, the same terms as Perl (?) itself, if we assume that Perl == perl 5, would mean a dual-GPLv2-and-above and Artistic 1.0 *only*. Now, the Artistic 1.0 licence is very vague and is considered neither GPL-compatible nor free by the Free Software Foundation [fsf.org]. And the GPL is well, the GPL [gnu.org] and has its own res

    • Do you realize this is the standard way of licensing Perl modules? What in the world made you single out this one module and this one author for this subject?

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
      • Do you realize this is the standard way of licensing Perl modules? What in the world made you single out this one module and this one author for this subject?

        I didn't single out Aristotle or his module in particular, nor accused him of doing anything wrong in particular. I just noted that in his general request-for-comments for the module because I noticed it there. (Better late than never, I guess).

        I just wanted to note that from now on, it would be a better idea from the legal standpoint to use a different wording of the licensing terms as I explained above to avoid the licensing problems that the "same as perl5" face.

        But thanks for noting that - I'

    • I don’t care. Show me someone who is having a problem.

      • With respect, by the time there is a problem, it's rather too late to change the license text.

        I've updated my modules to read that they are available under the same license as the Perl 5.8.x series.

        • That’s a different matter (and thanks for pointing it out; I’ma fix my module template right now).

          What Shlomi is asking for is a complete change of licences. Now, neither option in the Perl (5.8) licence is my personal best preference. (I like the LGPL best.) But that’s how 99.5% of the CPAN is licensed, and since these terms don’t cause big problems in practice, there’s more value in not forcing the user to evaluate yet another licence than there is in having slightly better

          • I misunderstood your concern; I agree with the desire to stay compatible with the rest of the CPAN.

  • IMO, doing math on dates with DateTime is asking for trouble because you are working with seconds. Date::Simple works with days and Date::Piece extends that to add some nice syntax.