QDate range extended

Thiago Macieira thiago at kde.org
Fri Jun 9 19:44:36 BST 2006


Frans Englich wrote:
>On Tuesday 30 May 2006 15:04, Thiago Macieira wrote:
>> I have committed a new qt-copy patch that extends the range of QDate,
>> as requested on this mailing list a while ago.
>>
>> I'd like those who requested such a feature to test the new
>> functionality and let me know if this is enough for their needs.
>
>I think it would be practical with a mechanism to determine whether a
> date is flagged as invalid because of that it is outside QDate's range,
> or because the date itself is invalid(non-existant date). KDateTime
> provides isTooEarly() and isTooLate(). Yes, this is not specific to or
> triggered by the range-extension.
>
>The reason is that when you have an invalid date, you don't know if it
> is so because of an invalid date(user error, so to speak), or that
> QDate is incapable of representing a valid date(the software is
> lacking).

There's no way to do that. We've only got one variable to play with, and 
that's the number of julian days since the epoch (25 Nov -4713).

We can't break binary compatibility. The only option would be to use one 
other special JD numbers, like 0xFFFFFFFF.

But I question the wisdom that. If the date is invalid, why do you care if 
the year was less than -4713 or more than 11754508?

The date is invalid, period.
-- 
Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
  thiago.macieira (AT) trolltech.com     Trolltech AS
    GPG: 0x6EF45358                   |  Sandakerveien 116,
    E067 918B B660 DBD1 105C          |  NO-0402
    966C 33F5 F005 6EF4 5358          |  Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060609/23971bf9/attachment.sig>


More information about the kde-core-devel mailing list