Reading the date currently displayed by DayBack?

Notes on our latest calendar for FileMaker 13,: DayBack
Posts: 66
Joined: Wed Nov 27, 2013 5:51 am
PostPosted: Sat May 12, 2018 3:56 pm
Quick question -

I need to retrieve and use the date that is the current focus of the DayBack calendar display - the date of the day displayed by the vertical resource view, and the date of the first day of the week displayed by the week view.

Of course, that date changes as I move from day to day or week to week.

Where can I read that date?

Thanks!
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Mon May 14, 2018 9:51 am
Hi wsmiii,

While we don't save the current focus date in any variables, you can retrieve the start and end date range with the variables "$$sc_DateRangeStartAutoGlobNum" and "$$sc_DateRangeEndAutoGlobNum".

I'd love to hear your use-case scenario for reading the current focus date in the calendar. If it's something you feel that is necessary for the functionality of your solution, we can add it as a feature-request to be implemented in a future build of DayBack.

Regards,

KC
Posts: 66
Joined: Wed Nov 27, 2013 5:51 am
PostPosted: Sun May 27, 2018 6:29 am
Thanks for those variables. I knew the value must be visible somewhere.

My users designate alternating weeks as "Week 1" versus "Week 2," because their routines vary depending upon which week it is. Schedulers wanted "Week 1" or Week 2" displayed on the Calendar to make scheduling easier.

I didn't think "Getweekofyear" would work because our weeks go right on alternating across the year boundaries. GetWeekOfYear resets at the beginning of each year, which can throw this off.

So I used your suggested variable in the following calculation:

Mod ( Truncate ( (($$sc_DateRangeStartAutoGlobNum - 6361884800) / 604800) ; 0 ); 2)

Which returns a 0 or 1 on alternating weeks.

6361884800 is the number of seconds from 1/1/1900 to 1/1/2017 (used because Jan 1 fell on a Monday).The calc divides the number of seconds since 1/1/2017 by the number of seconds in a week, truncated to a whole number count of the weeks since 1/1/17. The Mod function returns 1 or 0, which I will use to get "Week 1" or Week 2" (as soon as someone gets back to me whether the week of 1/1/17 was a "Week 1" or a "Week 2"). This value will continue alternating properly across year boundaries.

I think it would be cool (and sufficient) if you included information about these variables in your documentation.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Tue May 29, 2018 1:03 pm
Thanks, wsmiii,

Glad using the $$sc_DateRangeStartAutoGlobNum variable worked for you.

I'll get that added into our docs so other users can take advantage of those variables!

Regards,

KC

Return to DayBack Calendar for FileMaker

Who is online

Users browsing this forum: No registered users and 4 guests

cron
(855) SEEDCODE
[email protected]
Follow us: