DateModel

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

DateModel

Postby leeuwen » Thu Oct 29, 2009 9:50 am

Hi all, while implementing the DateModel I got a bit confused with the 'min-/max-date', 'allowed range' and 'valid date' concepts. Could someone please explain how they relate and what they are exactly supposed to do? I have read the Javadoc and searched the forums, but still a bit unclear to me. I am planning to use this model in the CalendarViewer so it would be helpful to know how the three concepts above relate to the CalendarViewer.
Thank you for your time, any help is much appreciated!
Cheers,
Paul
pjvleeuwen@gmail.com

Extraction from Javadoc for reference:

getMinDate - Gets the minimum date allowed.
Returns: the minimum date.

getMaxDate - Gets the minimum date allowed.
Returns: the minimum date.

dayInRange - Checks if the date is in allowed range.
Parameter: calendar - date to be checked.
Returns: true if the calendar is in the allowed range.

monthInRange - Checks if the month is in allowed range.
Parameter: calendar - month to be checked.
Returns: true if the month value in calendar is in the range.

yearInRange - Checks if the year is in allowed range.
Parameter: calendar - year to be checked.
Returns: true if the year value in calendar is in the range.

isValidDate - Checks if the date specified in calendar is a valid date.
Parameter: calendar - date to be checked.
Returns: true if the date specified in calendar is a valid date. Otherwise, false.
leeuwen
 
Posts: 7
Joined: Thu Oct 29, 2009 7:44 am

Re: DateModel

Postby JIDE Support » Thu Oct 29, 2009 10:11 am

We will improve our javadoc accordingly. Basically min/max date are the same concepts with the "allowed range" while JIDE implements DefaultDateModel. And you can set a bunch of DateFilter to DefaultDateModel which marks some of date as invalid date. That means, if a date is valid, it first has to be in the range defined by min/max date then it can get through all the existing DateFilters.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: DateModel

Postby leeuwen » Thu Oct 29, 2009 10:29 am

Thank you, that helps. I want to implement the DateModel myself because we have performance issues with selecting large ranges of dates. Our data model only works with successive full months, so always from the first day of some month till the last day of some later month. Also our data does not work with java.util.Calendar's so I hoped to improve performance by working directly on our data model. Therefore I need to make sure to understand what the methods are supposed to do.

for example, this monthInRange gets a calendar parameter: am I only supposed to look at the Month field of the calendar, or am I supposed to look at the combined Month+Year fields? (I suppose that I can ignore the DayOfMonth field?)

Thanks again
leeuwen
 
Posts: 7
Joined: Thu Oct 29, 2009 7:44 am

Re: DateModel

Postby JIDE Support » Thu Oct 29, 2009 10:53 am

Please look at the combined Month+Year fields for implementing monthInRange().

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 84 guests