NetTalk Central

Author Topic: Can popup calendar be made to start on a Monday?  (Read 3568 times)

seanh

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • Email
Can popup calendar be made to start on a Monday?
« on: September 10, 2017, 09:49:27 PM »
Hi all

Can the popup calendar be made to start on a Monday?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can popup calendar be made to start on a Monday?
« Reply #1 on: September 10, 2017, 10:39:00 PM »
yes.

the option is called firstDay (and it's case sensitive.)
http://api.jqueryui.com/datepicker/#option-firstDay

If you want to do it for just one calendar, then set it in the embed right
before that calendar is created. For example;

value::MAI:StartDate  Routine
.....
p_web.SetOption(loc:options,'firstDay',1)
.....
packet.append(p_web.CreateDateInput .....


If you want to set it for all the lookup calendars, then go to the
WebHandler procedure, to the CreateDateInput method.
Before the parent call there, put

self.SetOptions(p_Options,'firstDay',1,true)

! the last parameter there specifies this is a default value, and can still
be overridden if desired at the local level.

Cheers
Bruce



jari@softmade.fi

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Re: Can popup calendar be made to start on a Monday?
« Reply #2 on: September 16, 2017, 12:55:38 AM »
Hi Bruce
 
I put "self.SetOptions(p_Options,'firstDay',1,true)"  in  "p_web.CreateDateInput PROCEDURE"  but got error: Field not found: SETOPTIONS

Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: Can popup calendar be made to start on a Monday?
« Reply #3 on: September 17, 2017, 11:36:05 PM »
What NetTalk build are you on?

update: should be SetOption of course, not SetOptions.
« Last Edit: September 18, 2017, 09:24:34 PM by Bruce »

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Re: Can popup calendar be made to start on a Monday?
« Reply #4 on: September 18, 2017, 01:55:35 AM »
Hi Bruce

9.28

This works fine  in one calendar place but it would be nice to translate all in Webhandler procedure

       p_web.SetOption(loc:options,'firstDay',1) 
        p_web.SetOption(loc:options,'dayNamesShort','["Ma", "Ti", "Ke", "To", "Pe", "La", "Su"]' )
        p_web.SetOption(loc:options,'dayNamesMin','["Ma", "Ti", "Ke", "To", "Pe", "La", "Su"]' )
        p_web.SetOption(loc:options,'monthNames','[ "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu",   "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" ]')
        p_web.SetOption(loc:options,'prevText','"Edellinen"')
        p_web.SetOption(loc:options,'nextText','"Seuraava"')
        p_web.SetOption(loc:options,'currentText','"Tänään"')
        p_web.SetOption(loc:options,'closeText','"Peru"')

rainerwallenius

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • Email
Re: Can popup calendar be made to start on a Monday?
« Reply #5 on: September 18, 2017, 07:39:39 AM »
Hi Jari

I have this piece of code in webhandler processlink embed:

    Self.site.DateOptions = '' & |
        'monthNames: [''Tammi'',''Helmi'',''Maalis'',''Huhti'',''Touko'',''Kesä'',''Heinä'',''Elo'',''Syys'',''Loka'',''Marras'',''Joulu'']' &|
        ',monthNamesShort: [''Tam'', ''Hel'', ''Maa'', ''Huh'', ''Tou'', ''Kes'', ''Hei'', ''Elo'', ''Syy'', ''Lok'', ''Mar'', ''Jou'']' &|
        ',dayNames: [''Sunnuntai'', ''Maanantai'', ''Tiistai'', ''Keskiviikko'', ''Torstai'', ''Perjantai'', ''Lauantai'']' &|
        ',dayNamesMin: [''Su'', ''Ma'', ''Ti'', ''Ke'', ''To'', ''Pe'', ''La'']' &|
        ',dayNamesShort: [''Sun'', ''Maa'', ''Tii'', ''Kes'', ''Tor'', ''Per'', ''Lau'']'  &|
        ',closeText: ''Sulje'''  &|
        ',currentText: ''Tänään'''  &|
        ',dateFormat: ''dd.mm.yy'''  &|
        ',nextText: ''Seuraava''' &|
        ',prevText: ''Edellinen''' &|
        ',weekHeader: ''Vko''' &|
        ',showWeek: ''true''' &|
        ',firstDay: 1'  &|
        ',numberOfMonths: 2'

Takes care of all calendar popups

:: rainer

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Email
Re: Can popup calendar be made to start on a Monday?
« Reply #6 on: September 20, 2017, 09:54:59 PM »
Thanks Rainer :)

That works!
I still had to change with Scandinavian letters

      Self.site.DateOptions = '' & |
      'monthNames: [''Tammi'',''Helmi'',''Maalis'',''Huhti'',''Touko'',''Kesä'',''Heinä'',''Elo'',''Syys'',''Loka'',''Marras'',''Joulu'']' &|
      ',monthNamesShort: [''Tam'', ''Hel'', ''Maa'', ''Huh'', ''Tou'', ''Kes'', ''Hei'', ''Elo'', ''Syy'', ''Lok'', ''Mar'', ''Jou'']' &|
      ',dayNames: [''Sunnuntai'', ''Maanantai'', ''Tiistai'', ''Keskiviikko'', ''Torstai'', ''Perjantai'', ''Lauantai'']' &|
      ',dayNamesMin: [''Su'', ''Ma'', ''Ti'', ''Ke'', ''To'', ''Pe'', ''La'']' &|
      ',dayNamesShort: [''Sun'', ''Maa'', ''Tii'', ''Kes'', ''Tor'', ''Per'', ''Lau'']'  &|
      ',closeText: ''Sulje'''  &|
      ',currentText: ''Tänään'''  &|
      ',dateFormat: ''dd.mm.yy'''  &|
      ',nextText: ''Seuraava''' &|
      ',prevText: ''Edellinen''' &|
      ',weekHeader: ''Vko''' &|
      ',showWeek: ''true''' &|
      ',firstDay: 1'  &|
      ',numberOfMonths: 2'