Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  kiwioz 7 years, 6 months ago.

  • Author
    Posts
  • #73927

    kiwioz
    Participant

    Hi

    I am in Australia and I have set the date to be European but I am needing American time i.e 6:00 am – 5:00 pm and not military time.

    How can I do this?

     

    Craig

     

     

  • #73931

    admin
    Keymaster

    Try this – add the following to “Custom JS” section of Options.

    scheduler.config.hour_date =  “%g:%i %a”;

    scheduler.templates.event_date = function(date){

    var formatFunc = scheduler.date.date_to_str(scheduler.config.hour_date);

    return formatFunc(date);

    }

     

  • #73933

    kiwioz
    Participant

    Hi Ken,

    After adding the code the Calendar is not rendering.

    I duplicated the Default options and changed the date format to European and added your custom JS code.

    Could you try it on your end or have I missed something?

     

    Craig

    PS Thanks for you help.

  • #73935

    admin
    Keymaster

    The forum seems to be curling the quotes by accident. Make sure you’re using straight quotes as described on this page.

  • #73936

    kiwioz
    Participant

    Thanks Mate,

    Got it.

  • #73946

    kiwioz
    Participant

    Hi Ken

    I have done some more debugging on this issue, I have found that when I set the date to be European and using the Custon JS code to change the time to American the time field still shows European time. See image 1

    Steping though the debuger, when dragging and hitting the “Else If [ $event_type=”Edit” ]” step.

    Set Field By Name [ $toc & $date_start_field ; GetAsDate($from) ]

    Set Field By Name [ $toc & $date_end_field ; GetAsDate($to) ]

    Set Field By Name [ $toc & $time_start_field ; If ($untimed; GetAsTime(“”);GetAsTime($from)) ]

    Set Field By Name [ $toc & $time_end_field ; If ($untimed; GetAsTime(“”);GetAsTime($to)) ]

    Set Field By Name [ $toc & $event_unit_field ; $unit ]

    Set Field By Name [ $toc & $show_only_field ; 1 ]

    They are not setting the corect format. I have chage this code to

    Set Field By Name [ $toc & $date_start_field ; GetAsDate($from_utc) ]

    Set Field By Name [ $toc & $date_end_field ; GetAsDate($to_utc) ]

    Set Field By Name [ $toc & $time_start_field ; If ($untimed; GetAsTime(“”);GetAsTime($from_utc)) ]

    Set Field By Name [ $toc & $time_end_field ; If ($untimed; GetAsTime(“”);GetAsTime($to_utc)) ]

    Set Field By Name [ $toc & $event_unit_field ; $unit ]

    Set Field By Name [ $toc & $show_only_field ; 1 ]

    This has no affect. I have added the dataviwer with the list of veriables.

    I really need to come up with a solution for this

    Craig

    Attachments:
    You must be logged in to view attached files.

You must be logged in to reply to this topic.