You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Serge Knystautas <se...@lokitech.com> on 2002/07/28 06:37:53 UTC
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Lang addition: CalendarUtils
Posted by Serge Knystautas <se...@lokitech.com>.
I'll package it up this weekend and try to throw some JUnit tests in there
as well.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Henri Yandell" <ba...@generationjava.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>;
<st...@caswell.name>
Sent: Sunday, July 28, 2002 4:20 PM
Subject: RE: Lang addition: CalendarUtils
> The functionality definitely sounds good and a welcome addition to Jakarta
> Commons.
>
> 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.
>
> 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: <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Lang addition: CalendarUtils
Posted by Stephen Colebourne <sc...@btopenworld.com>.
> The current functionality of [util] is a needed one, but could we not call
> it something vaguer such as [misc] ?
[misc] is more suited to its current role as holding area. I think we should
revisit all of the [util] classes to see what could go in [lang] before 1.0
though. I feel [lang] is still a little 'bare'
> Times are basic features of a language [or at least should
> be, cf rebol] and I'm in favour of lang having a .time subpackage with
> many time based classes in. Such as a Time class etc :) Joda might be cool
> for that, I have to admit I still have to look at it.
Joda's time packages are/will be a full library in their own right with
perhaps 30+ classes. This will not fit within [lang]. Maybe a [time] at some
point, who knows... Thus a time subpackage would only contain CalendarUtils
and DateUtils (if needed).
Stephen
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Lang addition: CalendarUtils
Posted by Henri Yandell <ba...@generationjava.com>.
On Wed, 7 Aug 2002, Stephen Colebourne wrote:
> > 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.
>
I partially agree.
The current functionality of [util] is a needed one, but could we not call
it something vaguer such as [misc] ?
The separation of the util components from the lang components really
depends on how much there is in [util]. With collections missing it is
quite small. Times are basic features of a language [or at least should
be, cf rebol] and I'm in favour of lang having a .time subpackage with
many time based classes in. Such as a Time class etc :) Joda might be cool
for that, I have to admit I still have to look at it.
Hen
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Lang addition: CalendarUtils
Posted by Stephen Colebourne <sc...@btopenworld.com>.
> 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: <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Lang addition: CalendarUtils
Posted by Steven Caswell <st...@caswell.name>.
Inline...
> -----Original Message-----
> From: Henri Yandell [mailto:bayard@generationjava.com]
> Sent: Sunday, July 28, 2002 3:21 PM
> To: Jakarta Commons Developers List; steven@caswell.name
> Subject: RE: Lang addition: CalendarUtils
>
>
> The functionality definitely sounds good and a welcome
> addition to Jakarta Commons.
>
> 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.
+1
>
> 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: <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> > For
> additional commands,
> e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-dev-> unsubscribe@jakarta.apache.org>
> For
> additional commands,
> e-mail: <ma...@jakarta.apache.org>
>
>
Steven Caswell
steven@caswell.name
a.k.a Mungo Knotwise of Michel Delving
"One ring to rule them all, one ring to find them..."
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Lang addition: CalendarUtils
Posted by Henri Yandell <ba...@generationjava.com>.
The functionality definitely sounds good and a welcome addition to Jakarta
Commons.
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.
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: <ma...@jakarta.apache.org>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Lang addition: CalendarUtils
Posted by Steven Caswell <st...@caswell.name>.
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: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>