Patch for kdatepicker with weekStartDay != Monday

Reinhold Kainhofer reinhold at kainhofer.com
Thu Oct 16 10:42:44 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

yesterday I took a look at bug 65588 and wrote the attached patch for the date 
picker. So far, if the week start day was not monday, but the month started 
on a monday, a click selected the date a week ahead.

My patch cleans up the position <=> date conversion by introducing two 
(non-virtual, thus binary compatible) functions 
  int posFromDate( const QDate &date );
  QDate dateFromPos( int pos );
which do all the offset handling (due to week start day). Also, now the date 
picker behaves exactly the same no matter which weekStart day is selected (so 
far, there were checks for weekStartDay()<4 in the code, which didn't make 
sense to me...). There is always at least one day and at most 8 days of the 
previous month visible.

Now, before I commit, can somebody with more knowledge of calendar systems and 
locale settings take a look at it and tell me that it is correct?

If it's not not correct, I'll have to rework some code in korganizer, too...

Okay to apply?


- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Graz, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Mathematics Department, Graz University of Technology
 * Deltasoft mathematics, http://www.deltasoft.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/jmgXTqjEwhXvPN0RAnJVAKCwkFioCemcrlEFI5wkmOndx4x/rACgv8fo
OGgZSsSHvnGIWpxATT/z9LU=
=OCDU
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2003-10-15_kdeui_WeekStart_KDateTable_Bug65588.patch
Type: text/x-diff
Size: 7963 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031016/1f670169/attachment.patch>


More information about the kde-core-devel mailing list