Jump to content

This topic is 2494 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I am looking for a simple method to select a week in a year, based on an assumption that there are 48 weeks in a year (see mock up attached, where the grey week buttons are clickable).

The calendar picker in FM is great, but not suitable for my requirements, but I WOULD like my requested solution to be accessed in the same way (maybe returning something like YEAR, MONTH, WEEK_NUM.

Also, not that bothered if the week are 1-4 for each month or 1-48.

Has anything been built that i could leverage? Thanks

 

 

WeekPicker.jpg

Edited by jagstirling
Link to comment
Share on other sites

2 hours ago, jagstirling said:

see mock up attached, where the grey week buttons are clickable

So why don't you implement your mockup as a popover containing 48 buttons, all running the same script with a different parameter?

For simplicity, let's say the parameter is just a number between 1 and 48. Then your script could do:

Set Field [ YourTable::Year ; AnyTable::gYear ]
Set Field [ YourTable::Month ; Div ( Get (ScriptParameter) - 1 ; 4 ) + 1 ]
Set Field [ YourTable::Week ; Mod ( Get (ScriptParameter) - 1 ; 4 ) + 1 ]

where gYear is a the (global) field shown at the top of your picker.

 

2 hours ago, jagstirling said:

Also, not that bothered if the week are 1-4 for each month or 1-48.

Well, then you don't really need a Month field and could make this even simpler.

  • Like 1
Link to comment
Share on other sites

This topic is 2494 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.