commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: Lang addition: CalendarUtils
Date Tue, 06 Aug 2002 23:43:33 GMT
> The functionality definitely sounds good and a welcome addition to Jakarta
> Commons.
+1, although as I run the http://joda.sourceforge.net Joda time project that
is doing a rewrite of dates and times from scratch I have some interest in
this area. Some of these ideas might be useful ideas there too ;-)

> The only question in my mind is that CalendarUtils really should go into
> Commons.Utils and not Commons.Lang. Currently Commons.Utils is a little
> low on real Util functionality as most of java.util went to
> Commons.Collections. While Commons.IO is quite healthy and just needs some
> effort, Commons.Utils currently has a few utilities such as BitField,
> WordWrapper, a UniqueId and some other miscellaneous bits and bobs.
>
> My preference would be to submit the CalendarUtils to the Util sandbox and
> consider the virtues of migrating it to Lang during the preparation for a
> 1.0 release.

-0
The exact divisions between [lang] / [util], and [io] / [net] seems to come
up again and again. I believe that CalendarUtils should be in [lang], along
with BitField and the WordWrap stuff (the unique id stuff is now accessible
via [pattern]. To me, [util] is a holding ground for individual useful
classes looking for a home. With its current combination of classes [util]
can never IMO become a commons proper project.

Stephen

-----------------

> Having JUnit tests early is good. Saves on lots of work later on.
>
> Hen
>
> On Sun, 28 Jul 2002, Steven Caswell wrote:
>
> > I was planning to sit down this morning and write the truncate and round
> > methods myself, so I'd welcome the addition. The source repository
> > discusion as http://jakarta.apache.org/site/source.html is a good
> > reference for source format. And as a personal preference, I like to see
> > the junit tests as early as possible, because they give me a good sense
> > as to how the submission is used in real life.
> >
> >
> > Steven Caswell
> > steven@caswell.name
> > a.k.a Mungo Knotwise of Michel Delving
> > "One ring to rule them all, one ring to find them..."
> >
> >
> > > -----Original Message-----
> > > From: Serge Knystautas [mailto:sergek@lokitech.com]
> > > Sent: Saturday, July 27, 2002 11:38 PM
> > > To: commons-dev@jakarta.apache.org
> > > Subject: Lang addition: CalendarUtils
> > >
> > >
> > > I've got a CalendarUtils class I wrote this past summer that
> > > I'd like to
> > > offer up to the Lang project.  Here are the highlights...
> > >
> > > - truncate - you pass a date/calendar and a calendar field (i.e.,
> > > Calendar.MINUTE, Calendar.MONTH, or whatever), and it will
> > > truncate the
> > > date.  So if I did new java.util.Date() and that was 2002 July 28
> > > 12:31:49.410 am and I truncated that to the HOUR, I would get
> > > 2002 July
> > > 28 12:00:00.000 am.
> > >
> > > - round - same as above, except it rounds.  So with the same
> > > data, the
> > > rounding would give me 2002 July 28 1:00:00.000 am.
> > >
> > > Those are the main ones I seem to always need.  Here's another one I
> > > just added which is useful if you're creating month or
> > > calendar views...
> > >
> > > getCalendarIterator() - you pass it a Date/Calendar, and a
> > > calendar type
> > > that also represents how you want to represent it.  It will then give
> > > you an iteration of calendar objects for each day in the
> > > range it will
> > > calculate.  So... if I asked for the month view (weeks starting with
> > > Sunday), with the above datetime, I would get an Iterator of Calendar
> > > objects starting Sunday June 30th through Saturday August
> > > 3rd.  You can
> > > also do week views, and you can do weeks starting on Sunday
> > > or Saturday,
> > > or have the week centered on the date provided, or the week
> > > starting on
> > > the date provided.  Like I said, it's very useful if you're building
> > > dynamic month or week calendar views.
> > >
> > > I've spec'd out and really would like to get a String ->
> > > Calendar parser
> > > that can handle all the syntaxes supported by CVS, including
> > > "Yesterday", "one week ago", and "last monday".  This really
> > > shouldn't
> > > be too difficult if someone wants to add that (or if I get a chance),
> > > and it would make date entry so much more friendly for users.
> > >
> > > Let me know what format you'd like it in, assuming you'd want
> > > to include
> > > it.  I don't have nice junit tests setup, but I had hacked
> > > some simple
> > > tests together at one point... not sure how rigorous you're after for
> > > initial contributions.
> > >
> > > Thanks!
> > >
> > > --
> > > Serge Knystautas
> > > Loki Technologies - Unstoppable Websites http://www.lokitech.com/
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> > > For
> > > additional commands,
> > > e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> > >
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message