Page 1 of 1

Shortened Time Format on Month View

PostPosted: Mon Nov 18, 2013 2:52 pm
by hollyheadhunter
Hi guys,

On our previous calendar, we were able to view the start and end time of events using an abbreviated format -- which allowed us to see many events' start and end time. The time formats would look like this:

Monday Dec 4
10a-2p Event1
11a-2:15p Event2
2p-5p Event3

We'd used a custom function for the time display that went something like this:

If ( Hour ( text ) > 12 ; Hour ( text ) - 12 ; Hour ( text ) )
& If ( Minute ( text ) > 0 ; ":" & Minute ( text ) )
& If ( Right ( GetAsTime ( text ) ; 2 ) = "PM" ; "p" ; "a" )


Is there a way to set up the Month view to display times like this using your calendar?

Re: Shortened Time Format on Month View

PostPosted: Tue Nov 19, 2013 9:22 am
by jeffalmquist
You can edit the formatting of the time in the "Format Event Time --- Edit Time Formats for Events Here ---" script. Just change how the $sc_time variable is constructed in the Set Variable [$$sc_FormattedEvent; ...] step. HTH... Jeff

Re: Shortened Time Format on Month View

PostPosted: Tue Nov 19, 2013 12:38 pm
by hollyheadhunter
Thank you, Jeff!

In the script Format Event Time --- Edit Time Formats for Events Here ---, in the step Set Variable [$$sc_FormattedEvent; ...] step, I edited part of the script like this.


...
// -------------- ALL OTHERS -------------------

//Let ( [
//t1me = GetAsTime ( $$sc_DateTimeStart )
//];

Let ( [
t1me = If ( $$sc_Mode = "Month" ; GetAsTimeShorter ( GetAsTime ( $$sc_DateTimeStart ) ) ; GetAsTime (
$$sc_DateTimeStart ) )
];
...


Please note that the result of our custom function GetAsTimeShorter ( GetAsTime ( $$sc_DateTimeStart ) ) when tested is "10a" in an instance we are testing.

From the modification above, I expected it to display on month view as "10a Event1" but instead it displays as "?:0? pmEvent1".

What could I do to get it to display the result of our Custom Function "GetAsTimeShorter"?

Re: Shortened Time Format on Month View

PostPosted: Tue Nov 19, 2013 5:23 pm
by jeffalmquist
It's actually the $sc_time variable that you want to populate with the formatted time. Look in the "12 hour time" section a little farther down in that calc. Try replacing that series of If[] statements with your custom function. If you'd like to have us write the custom code for you we can do that, but we would have to charge for the development time. Let me know if that's something you'd be interested in.

Re: Shortened Time Format on Month View

PostPosted: Thu Nov 21, 2013 8:57 am
by hollyheadhunter
Jeff, Thank you. That worked like a charm. We love this calendar!

Re: Shortened Time Format on Month View

PostPosted: Thu Nov 21, 2013 10:06 am
by jeffalmquist
Terrific! Thanks for that feedback. :)