
MonthPicker v2.0
by Todd GeistMonthPicker v2 is an all new take on building a month picker with PopOvers. I demoed this at DevCon, but I have already made some updates to how this works. I got rid of several of the steps required to integrate this into your file.
Thanks to some more input from the community. It now works well on the entire FileMaker platform. Use it with FileMaker WebDirect, FileMaker Go and FileMaker Pro!
Virtual Triggers
This file has some examples of what I call Virtual Triggers. Virtual Triggers let you define your own triggers that get fired when ever you want them to. Think “Script Triggers”, but instead of only getting the ones FileMaker sets up for you, you get to define them anyway you want. They make really good hooks that you can use to let users of your module extend the behavior of your widget, without having to muck about in the code of your widget.
Getting the name of the Current PopOver
This module also features a technique for getting the name of the currently exposed PopOver. This is really useful for getting at objects that might be inside the PopOver, which is how we get implement Virtual Triggers for each instance of the PopOver.
Installation and Usage
See the README script, for information on how to install, and use this module. Note Step 4. Pass the name of the field you want to bind the widget to the PopOver OnObjectEnter Script trigger.
History
version 2.2.1 8/22/14
small fix. Calvin Cooper reported that one of the Calendar grid buttons had the wrong parameter.
It should have been set to 31. it was set to 30. 30 was used twice.
version 2.2 8/21/14
significant refactor
changed the Virtual Triggers to work with OnObjectEnter instead of OnObjectExit
several bug fixes and improvements related to Virtual Triggers and validation.
version 2.1.2 8/8/14
fixed the month title update bug on iOS. Thanks to JP Larson for pointing it out and suggesting a fix.
version 2.1.1 8/7/14
Fixed a bug in the conditional formatting to show selected date. Thanks to John Renfrew ( john@e-rwu.com ) for pointing that out.
version 2.1 8/4/14
got rid of the need for a relationship between the MonthPicker TO and the current TO
Download
Download it here:MonthPicker.fmp12
Todd
the middle conditional formula for the date cells is broken…
“/*/*¶The Selected Date¶*/¶¶Let(¶[¶¶¶selectedDate = MONTHPICKER:: ¶¶];¶¶¶¶selectedDate = Self¶¶¶¶)*/”
is this designed to show the selected date as opposed to the current date???
john
the $$Month_Picker_Value seems to change when stepping forwards or backwards a month with the arrows.. is this correct behaviour or should it be showing the linked DateField value??
john
Yes thanks for pointing this out. This is a bit of an issue. I’ll get a new version up in a little bit
Thanks
Todd
Todd-
FYI- The new date picker does not refresh the month Title in FM Go. It works perfectly in FM Pro though..
yeah, I never tested it on Go. I’ll take a look at it on go at some point. maybe webdirect too. 🙂
Todd
Hi Todd
Nice technique, I wanted to download but the link is broke.
Raul
from Peru
hmmm not sure how that broke. but it is fixed now.
Thanks
Todd
FYI-
Don’t know if this is the best way but I added a Refresh Object [Object Name “MonthPickerPopOver”] to the end of the Calendar Button ( Various) Script and that seemed to fix it…
Thats close, but the better place to add that is to the Private “DatePicker Engine” script.
I just uploaded a new version that does just that. Thanks for taking the time to investigate. Now it works on Go, Pro and WebDirect. Thats the the Magic of Modular 🙂
Todd
This looks very nice indeed. One thing I noticed though, since I live outside the U.S.: Everywhere in the world except in the U.S., the week starts on Monday; in MonthPicker it starts on Sunday, regardless of the system date settings.
Yes, that is true. It doesn’t know anything about the system setting. I have thought about adding support for starting on Monday, but I haven’t done it yet.
Thanks
Todd
Todd, Thanks for this nice date picking feature. Is there a way I can update just the script to this updated version (8-8-14) instead of having to update all my buttons also? I tried but had no success.
[…] release at Modular FileMaker. MonthPicker v2 is an all new take on building a month picker with PopOvers. I demoed this at […]
Todds thanks for very useful module (Month Picker). Can just like month picker is there any modular script for Numeric value (0-9) picker table . Instead of typing any numeric value in data field the value should be automatically inserted in the selected field by selecting the desire numbers from the table. Apart also this table can be used for calculator table.
Friend Todds
Thanks for very useful module (Month Picker). Can just like month picker is there any modular script for Numeric value (0-9) picker table . Instead of typing any numeric value in data field the value should be automatically inserted in the selected field by selecting the desire numbers from the table. Apart also this table can be also used for calculating as calculator table.
Hi, I there a way to set s script to start the calendar at a certain month?
Hi, The calendar starts on the month of the date in the field it is bound to. If that date field is empty then it starts with the current month. If you want to use a different date then change the field before it opens. hth – todd
Thanks, what script gets that info. I can send a variable to that. I can’t really set the field before the calendar opens.
The calendar works by being “bound” to a field. It takes it’s value from a field and updates that same field when it is closed.
All that happens in the script that fires when you open the popOver. Take a look at that script, you might be able to do something in there.
Todd
Hey Todd, thanks for the month picker… I had to hack it so the user could select multiple dates. I did not do it modular justice but here it is for v3 feature consideration. http://rivetcom.ca/_fmforums/MonthPicker-Multi.zip
Hi all,
great little tool, it works well for what I need………mostly!!
Just wondering if there was a way we could sort the dates as they are being entered into the box. I am actually using the hacked version not the original as it is more suited for what I need. I have altered it a little to display the dates side by side and I have edited the validation script to check as a LeftWords as opposed to a single date.
What I would like to do is when the dates are inserted into my array, they are put into their correct chronological order.
Anyone have any idea how I could achieve this??
Hi Lloyd,
Sorry I am not sure I understand what you mean. Can you clarify?
Todd
Todd,
I think Lloyd is using David’s hacked version (multi date picker) so the question should really be directed at him.
David, can you briefly document the changes you made. I’d find this multi date picking feature v. useful as well, (+1 on it being a v3 feature) and would love to add it to the version I’ve hacked to show good/bad dates in my calendar according to my biz logic requirements, which….
….. I could not have done had Todd not done such a great job in the first place on this excellent module. Many thanks Todd, a perfect modular unit example: able to bolt onto any existing system using the minimum foothold and overhead. Obviously from these reports it’s also eminently adaptable.
Exactly what it says on the tin, thanks again Todd.
Jason