Recent

Author Topic: CalLite problem....  (Read 1843 times)

iglezakis

  • New member
  • *
  • Posts: 5
CalLite problem....
« on: September 13, 2021, 08:04:34 am »
Hi.

i'm trying to make a calendar application using CalendarLite (two (2) components that acts as FROM date - TO date.

prob. 1: if then FROM month has 31 days and the TO month has 30 or 29/28 and i select the LAST day of the FROM month, when changing TO month an error occurs saying the "TO" month has no 31/mm/yyyy date . Example: FROM month selected date 31/12/2021 . change to NOVEMBER without changing the date (selecting month from the month selection dropdown list) appears an error that says 31/11/2021 is not valid (see pic No 2)

prob. 2: i got the latest (i presume) SVN and TRY to compile it and i'm getting the following error (see pic). I have a previous version of CalLite already installed but i don't think that this is the problem of compilation.

Thank in advance.

:o)
« Last Edit: September 13, 2021, 08:30:42 am by iglezakis »

wp

  • Hero Member
  • *****
  • Posts: 8897
Re: CalLite problem....
« Reply #1 on: September 13, 2021, 09:41:26 am »
(1) I don't understand. Please post a small compilable project showing the issue (only .pas, .lfm, .lpi and .lpr files, packed to a common zip).

(2) You seem to have a very old Laz version, v1.6, which I don't use any more. I am able to compile with Laz 1.6.4, but not with 1.4.4. What is your FPC version? Anyway, I replaced the comparison expression by a function SameRect which should work always. This is in the svn repository, for the moment.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

iglezakis

  • New member
  • *
  • Posts: 5
Re: CalLite problem....
« Reply #2 on: September 13, 2021, 10:33:12 am »
Hi.

Follow the steps bellow....

1/   select month with 31 days (October) and select 31/10/2021 as selected date
2/  open the "Month Selection DropDown List" and select a month with LESS days (let's say September)
3/  eror message appears on screen (2021-9-31 is not a valid date specification
4/  from within Lazarus IDE v1.6 show an Debugger Expeption Notification that says
       "Project project1 raised exception class 'EConvertError' with message..." (above (3) message...)

The version i have is 1.6, Date: 2021-08-09, FPC Version 3.0.0, SVN Revision 51630, i386-win32-win32/win64

i include the test project...

wp

  • Hero Member
  • *****
  • Posts: 8897
Re: CalLite problem....
« Reply #3 on: September 13, 2021, 03:42:01 pm »
OK, I understand now. In which way should it be fixed?

Possibility 1: When going from the 31st to a month with 30 (or 28/29) days the day will be adjusted to the correct last day of the new month. The problem is that when the user wants to navigate through the last days of consecutive months the selected day will stick to 30 (or 28 or 29) even when the new month has more days. We have this behaviour already when months are navigated with the arrow keys.

Possibility 2: When starting with the last day of a month this is interpreted as "go to the last day of the new month". The problem is that when the user starts with Sep 30 he cannot reach Oct 30 this way. Another problem appears when the user starts at Jan 30 and goes to Feb: To have a valid date the day must change to 28 (or 29) which is the last day of the month now, and the next month, say March, will switch to day 31 rather than 30 in this mode. Quite confusing.

Possibility 3: The dropdown menu could disable all months which cannot be reached from the currently selected date. Quite fair, we already have this with the years. But seeing disabled features is always a frustrating user experience.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

Zvoni

  • Hero Member
  • *****
  • Posts: 739
Re: CalLite problem....
« Reply #4 on: September 13, 2021, 04:17:45 pm »
Possibility 4: Oct 31st 2021 is a Sunday.
Going back 1 Month, Check which weekday is Sep 30th 2021 (EndOfMonth --> =Wednesday). Move it forward to the next Sunday (Oct 3rd).
The Same with going Forward. Nov 30th is a Tuesday, next Sunday would be Dec 5th

Possibility 5: Don't set the Value at all when moving months (i think that's the initial problem/bug). Only after User explicitely selects a day in the "new" month.....
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
People call me crazy, because i'm jumping out of perfectly fine aircraft

iglezakis

  • New member
  • *
  • Posts: 5
Re: CalLite problem....
« Reply #5 on: September 15, 2021, 03:12:13 pm »
hi (agian)

why not use the Possibility (1) which sounds fine. Moving from months with 31 days to months with 30 days stays to 30. Moving from January 31 to February 28/29 stays to 28/29 if you move to March etc. I don't think that is a problem doing so.

The possibility of disable months that not have the same number of dates as the primarily selected one is NOT a good idea. Because someone may want to select from 15/09/2021 - 15/10/2021. Doing so (disable) he/she cannot do that.

P.S.
I have download (something) new version of CalLite, the one with the modified lines. Still cannot pass the package compilation.
« Last Edit: September 15, 2021, 03:15:13 pm by iglezakis »

wp

  • Hero Member
  • *****
  • Posts: 8897
Re: CalLite problem....
« Reply #6 on: September 15, 2021, 03:31:24 pm »
I already have uploaded a version which handles the case (1), i.e. move to the next valid day of a month and stay there. This version is in OPM already.

The offending TRect comparison operator has been removed in this version. So I do not understand why your compilation does not work. Did you try a "clean" compilation of the package?
« Last Edit: September 15, 2021, 04:03:58 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

iglezakis

  • New member
  • *
  • Posts: 5
Re: CalLite problem....
« Reply #7 on: September 16, 2021, 10:43:58 am »
Dear wp....

once again i can't imagine what is going wrong.

just download the callite-0.3.8.zip from https://sourceforge.net/projects/lazarus-ccr/files/CalLite/

i have UNISTALL and REBUILD my Lazarus 1.6.0 so it is CLEAN from any previous version of CalLite.
After restarting Lazarus, went to the folder where CalLite 0.3.8 was unzipped and open .lpk (from within Lazarus).
Compile....

an i got the error in the pic.

i DON'T have any problem (compile - install) with 0.3.3 which i use for now.

wp

  • Hero Member
  • *****
  • Posts: 8897
Re: CalLite problem....
« Reply #8 on: September 16, 2021, 11:23:48 am »
Sorry, Laz 1.6 is not in my default tool chain and I forgot to recompile the package after the recent changes with this IDE. Now I did, and I fixed the issue - at least it works with Laz 1.6.4 (I do not have 1.6.0 any more). The new version is v0.3.9; it is available on ccr, but will soon also be on OPM.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

iglezakis

  • New member
  • *
  • Posts: 5
Re: CalLite problem....
« Reply #9 on: September 18, 2021, 06:06:25 am »
Hi

0.3.9 works PERFECT (compile - install (Laz 1.6.0 32bit) )

Thanks a lot. Sorry for the all fuzz but since its a VERY useful component (especially to me) it was something that need-to-be fixed.

Thanks a lot  :D :D :D

 

TinyPortal © 2005-2018