Support for our Calendar template, Time Tracking, Hierarchy and anything else you may be doing with FileMaker®. Welcome!
Subscribe via RSS

Back to seedcode.com
  

Log in Register Search SeedCode Support Forum Forum Index

Adding an iCal style time line to the schedule page

 
Post new topic   Reply to topic    SeedCode Support Forum Forum Index -> SeedCode Calendar
View previous topic :: View next topic  
Author Message
sws-solutions



Joined: 28 Sep 2007
Posts: 134
Location: UK

PostPosted: Wed Feb 24, 2010 6:36 am    Post subject: Adding an iCal style time line to the schedule page Reply with quote

I recently decided to add an indicator showing the current time range on the schedule view, similar to that found in iCal

Anyway, I thought I would share it...

Add a text box to the top portal row with your desired height and set conditional formatting with the following calculation choosing to set a fill colour etc as desired



---------------------------
Let (

timescale =
Case ( not IsEmpty (GetAsNumber(CalendarInterface::TimeScaleGlob)) ; GetAsNumber(CalendarInterface::TimeScaleGlob) ;
CalendarInterface::TimeScaleGlob = "half hour" ; 30 ;
CalendarInterface::TimeScaleGlob = "hour" ; 60 ) ;


Get(CurrentTime) ≥ CalendarRows::TimeDisplayCalcs and
Get(CurrentTime) < CalendarRows::TimeDisplayCalcs + timescale * 60

)

---------------------------

The portal row should now have an indicator as to the current time....



_________________
Steve Wright
SWS Solutions
Back to top
View user's profile Send private message
John Sindelar
SeedCode Staff
SeedCode Staff


Joined: 20 Nov 2003
Posts: 1926

PostPosted: Wed Feb 24, 2010 3:09 pm    Post subject: Reply with quote

Fantastc!

Here is what Steve is talking about (see the thing red line at 11am):



Here is a larger version.

I just used a field instead of a text block because I can't seem to get text blocks down to 1px in height (I used CalendarBlankRepsGlob). And you'll have to put this on each calendar tab you wish to see it (It doesn't make sense on the simple view or the month view).

VERY nice Steve; thanks!

...want to do one for the grid view? ;-)



_________________
John Sindelar
SeedCode LLC
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sws-solutions



Joined: 28 Sep 2007
Posts: 134
Location: UK

PostPosted: Fri Feb 26, 2010 7:37 am    Post subject: Reply with quote

I just decided to go the field route also after having trouble getting it small enough to look neat... It doesn't quite look right having it highlite a full row.

Great screenshot...



_________________
Steve Wright
SWS Solutions
Back to top
View user's profile Send private message
sws-solutions



Joined: 28 Sep 2007
Posts: 134
Location: UK

PostPosted: Sat Feb 27, 2010 4:07 pm    Post subject: Reply with quote

Just realised that this does not show after midnight, due to the times being 26:00 28:00 etc so heres what I have so far, which does show past midnight.

Code:

/*
Outputs a boolean 1/0
Conditional formatting is then a simple if Value is not equal to 0 : apply fill colour
*/

Let ( [

currentTime = Get(CurrentTime) ;
rowTime = Extend(CalendarRows::TimeDisplayCalcs) ;
normTime = Case ( rowTime > 86400 ;  rowTime - 86400 ; rowTime ) ;
actualScale = Extend(CalendarInterface::TimeScaleGlob) ;

timescale =
Case (
not IsEmpty (GetAsNumber(actualScale)) ; GetAsNumber(actualScale) ;
actualScale= "half hour" ; 30 ;
actualScale = "hour" ; 60 )

] ;

currentTime ≥ normTime and currentTime < normTime + timescale * 60

)



_________________
Steve Wright
SWS Solutions
Back to top
View user's profile Send private message
Paul Fenley



Joined: 07 Mar 2006
Posts: 6
Location: Eugene, OR

PostPosted: Wed Mar 03, 2010 4:13 pm    Post subject: Calendar Pro 4.2 Adaptation Reply with quote

Thanks for the great idea. I'm adapting this for Pro 4.2 and am not able to display the highlight at the "30" or "half hour", for some reason. Also, I'm not able to figure out how to make this work without refreshing the window at each 30 minute interval. I have the following code set for a conditional on a global text field I added to the Hours table [HourSchedulingTimeLineGlob]. Any help would be appreciated. I'm running FMS/P 10 on Mac 10.5.X

Code:

/*
Outputs a boolean 1/0
Conditional formatting is then a simple if Value is not equal to 0 : apply fill colour */

Let ( [

currentTime = Get(CurrentTime) ;
rowTime = Extend(CalSchedHours::HourTimeDisplayCalc) ;
normTime = Case ( rowTime > 86400 ;  rowTime - 86400 ; rowTime ) ;
actualScale = Extend(CalendarScheduling::CalHourScaleGlob) ;

timescale =
Case (
not IsEmpty (GetAsNumber(actualScale)) ; GetAsNumber(actualScale) ;
actualScale= "half hour" ; 30 ;
actualScale = "hour" ; 60 )

] ;

currentTime ≥ normTime and currentTime < normTime + timescale * 60

)



_________________
--Paul
Back to top
View user's profile Send private message Visit poster's website
John Sindelar
SeedCode Staff
SeedCode Staff


Joined: 20 Nov 2003
Posts: 1926

PostPosted: Wed Mar 03, 2010 4:28 pm    Post subject: Reply with quote

Hey Paul: very cool.

Try using HourTime_k instead of HourTimeDisplayCalc. That should get you showing at other time increments.

I'm not sure what you mean about refreshing at every 30 min interval: send us some more details if the change above doesn't help.

John



_________________
John Sindelar
SeedCode LLC
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Paul Fenley



Joined: 07 Mar 2006
Posts: 6
Location: Eugene, OR

PostPosted: Wed Mar 03, 2010 5:06 pm    Post subject: Reply with quote

Thanks John. Everything seems to be working with your change. The window refresh is no longer an issue. Thanks a lot! I've been twiddling with this for 2 days!! Haha! My staff really likes how easy it is to spot the current timeline for the appointments they have. There should be a tax on how much fun I (we) have with your code!



_________________
--Paul
Back to top
View user's profile Send private message Visit poster's website
Paul Fenley



Joined: 07 Mar 2006
Posts: 6
Location: Eugene, OR

PostPosted: Thu Mar 04, 2010 1:52 pm    Post subject: Reply with quote

I do have an issue with the new timeline advancement, after all...

Using the calendar's "Schedule" layout, and the timeline is at the correct position, I do work in another database window and 3.5 hours later, I notice, on the calendar's window in the background, that timeline is still positioned at the old time, 3.5 hours ago. Even when I click on the calendar window, the highlight stays on the old time. Not until I change to another calendar layout and go back or click on the "Go to Today" button does the timeline advance correctly.

Is there a method I can use to have the timeline always get positioned, automatically?



_________________
--Paul
Back to top
View user's profile Send private message Visit poster's website
John Sindelar
SeedCode Staff
SeedCode Staff


Joined: 20 Nov 2003
Posts: 1926

PostPosted: Thu Mar 04, 2010 4:24 pm    Post subject: Reply with quote

the timeline relies on an unstored calc, so anything you do to refresh the window (change tabs, make events, edit records, etc) will cause the timeline to move. It won't move on its own, an unfortunately selecting the window isn't enough to cause it to refresh.

However, using FileMaker 10 you can install on OnTime script trigger that refreshes the window every x minutes.



_________________
John Sindelar
SeedCode LLC
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sws-solutions



Joined: 28 Sep 2007
Posts: 134
Location: UK

PostPosted: Thu Mar 04, 2010 5:05 pm    Post subject: Reply with quote

Using the OnTimer trigger, you could set it to refresh based on the current calendar scale, so on a 15 min scale, refresh every 15 minutes..

since there is obviously no point refreshing (unless you want to) every 15 mins for a 1 hour timescale.

You would just need to re-instate the OnTimer trigger when / if you change the timescale.



_________________
Steve Wright
SWS Solutions
Back to top
View user's profile Send private message
Paul Fenley



Joined: 07 Mar 2006
Posts: 6
Location: Eugene, OR

PostPosted: Fri Mar 05, 2010 10:30 am    Post subject: Reply with quote

Thanks John & Steve. That did the trick. I was thinking about a trigger plug-in, but wanted to hear from the experts. Thanks again.



_________________
--Paul
Back to top
View user's profile Send private message Visit poster's website
sws-solutions



Joined: 28 Sep 2007
Posts: 134
Location: UK

PostPosted: Thu Mar 18, 2010 3:03 pm    Post subject: Reply with quote

Just thought you may be interested to know, at midnight, the line will show across all rows in the 'all day' section, since it has only just come to my attention I have not looked into it yet...

P.S.. think I have a browser cache issue, every time I visited the forum recently it showed no new posts... but theres loads Sad



_________________
Steve Wright
SWS Solutions
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SeedCode Support Forum Forum Index -> SeedCode Calendar All times are GMT - 9 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Home | Products | Contact Us

Powered by phpBB © 2001, 2005 phpBB Group
Theme created by Vjacheslav Trushkin

Telephone: (206) 715-2126