Jump to content


Photo

NxDatePicker and Beginning of the Week


  • Please log in to reply
17 replies to this topic

#1 Lukas

Lukas
  • Members
  • 46 posts
  • Gender:Male

Posted 16 June 2007 - 06:50 PM

Hello,

is it possible to start the week at monday and not at sunday?

Thank you for answers.


Best Regards
Lukas

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 16 June 2007 - 07:20 PM

Hello Lukas,

I have add this in my release, it is called StartDay property. If you want, I may send you latest release on E-mail with this option on.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Lukas

Lukas
  • Members
  • 46 posts
  • Gender:Male

Posted 16 June 2007 - 08:40 PM

Hi Boki,

thank you for your supply, but I think it will work till the next release wink.gif
Is "Monday" the default value for the property StartDay?
Nowadays in nearly all countries monday is the beginning of the week, isn't it?

Best Regards
Lukas

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 16 June 2007 - 08:45 PM

Hello Lukas,

Sunday is still default value, because then this will be changed in existing applications too.

I am thinking about one non visual NxLocal component to handle all this settings globaly.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 Lukas

Lukas
  • Members
  • 46 posts
  • Gender:Male

Posted 20 June 2007 - 11:16 PM

Hi Boki,

I looked for the month names in your sourcecode and think, it could be better when you use the local names:

Your code:
CODE
function TNxDatePopup.GetDayInWeekChar(DayInWeek: Integer): Char;
begin
  Result := 'S';
  if Assigned(FDayNames) and InRange(DayInWeek, 1, 7)
    and (FDayNames.Count >= 7) then Result := FDayNames[DayInWeek - 1][1] else
  case DayInWeek of
      1: Result := 'S';
      2: Result := 'M';
      3: Result := 'D';
      4: Result := 'M';
      5: Result := 'D';
      6: Result := 'F';
      7: Result := 'S';
  end;
end;


Possible method:
CODE
function TNxDatePopup.GetDayInWeekChar(DayInWeek: Integer): Char;
begin
  Result := 'S';
  if Assigned(FDayNames) and InRange(DayInWeek, 1, 7)
    and (FDayNames.Count >= 7) then Result := FDayNames[DayInWeek - 1][1] else
  Result := LongDayNames[DayInWeek][1];
end;



And there exists a second method named "LongMonthNames" for the months.

Think about it and tell us your decision wink.gif


Best Regars
Lukas

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 20 June 2007 - 11:29 PM

Hello Lukas,

I was think about this too, and I will include it. Thank you.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 20 June 2007 - 11:33 PM

PS. I only have a small problem with LongDayNames because there is now a StartDay property. When Monday is StartDay, I will write LongDayNames[DayInWeek + 1][1].

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 20 June 2007 - 11:47 PM

Here is a final code:

CODE
  if Assigned(FDayNames) and InRange(DayInWeek, 1, 7)
    and (FDayNames.Count >= 7) then Result := FDayNames[DayInWeek - 1][1] else
  case FStartDay of
    dwSunday: Result := LongDayNames[DayInWeek][1];
    dwMonday: if DayInWeek = 7 then Result := LongDayNames[1][1]
      else Result := LongDayNames[DayInWeek + 1][1];
  end;


If someone is interested for new release (developement version), please contact me.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 21 June 2007 - 12:31 PM

Hi,

I think the first day of the week is also obtainable thru the locale info.
G.W. van der Vegt

#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 21 June 2007 - 12:35 PM

Hello Wim,

This will be great, but I couldn't find it sad.gif

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#11 coasting

coasting
  • Members
  • 29 posts
  • Gender:Male
  • Location:Germany

Posted 22 June 2007 - 09:52 PM

Hi all,

i do here found an interesting thread about locale and first-day-of-week problem.
Best would be to leave it up to people using the application... and btw i'm interested in receiving your new version, even its only development status...

brgds
coasting

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 22 June 2007 - 10:08 PM

Hello Coasting,

I have read this thread. Thank you.

But, I have thinking that is maybe better to have a property as I have now, or add a one new item in property list (dwSunday, dwMonday, dwAutomatic). When it is set dwAutomatic, it will read from GetLocaleInfo.

Please contact me via e-mail and I will send you developement version. Please note that you will receive it tomorow since I need to close some open code gaps first.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#13 coasting

coasting
  • Members
  • 29 posts
  • Gender:Male
  • Location:Germany

Posted 22 June 2007 - 10:26 PM

I think yr intended property list will suite my needs...

have sent you an email under registered account

brgds
coasting

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 23 June 2007 - 12:32 PM

Hello Coasting,

I have send it to you. Please note that maybe some open gaps are still exist.

Please tell me if spam filter have block it.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#15 coasting

coasting
  • Members
  • 29 posts
  • Gender:Male
  • Location:Germany

Posted 23 June 2007 - 06:50 PM

Hi Boki,

safely arrived here and working well.
Noted that you are giong to put all locale setting in separate component TNXLocalizer. Suppose that this will in future hold all loacale settings for Berg Components?

brgds
coasting

#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 23 June 2007 - 06:58 PM

Hello Coasting,

Yes, but it still in developement, I don't recommend using it yet but any suggestion for this component is welcome.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#17 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 27 June 2007 - 12:05 PM

Hi Boki

From my madExcept plugins (see the two constants, both may be handy for the popup calendar):

UpdateLocaleStatus(fIFirstDayOfWeek, fLocale, LOCALE_IFIRSTDAYOFWEEK);
UpdateLocaleStatus(fIFirstWeekOfYear, fLocale, LOCALE_IFIRSTWEEKOFYEAR);
G.W. van der Vegt

#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 27 June 2007 - 12:08 PM

Hello Wim,

I have add it already with LocaleInfo, if user set StartDay to dwAutomatic. If you want, I may send you a new release.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users