About This File
It's been quite a while since I put up something up here, so I thought I might as well share something that could potentially be useless hours of my work, but a bit useful (hopefully). This could potentially be somewhere already that I could not find, but I'll post it here anyways.
This program would not have been possible had it not been for the function LM:GrText, therefore huge credits to Lee Mac for his amazing function to assist with this program.
For you programmers who mainly deal with dates, here's a subfunction that uses a dialog box to visualize a calendar for the selection of a specific date. Call the function JH:DatePicker to start the function. The function takes in three arguments, which could all be nil for defaults, or the following below:
-
The first argument takes in a string that represents the title of the dialog box to display.
- Supplying nil or a blank string will use "Date Picker" by default on the title.
-
The second argument takes in a list of three integers, representing the year, month, and day respectively to highlight on initializing the dialog.
- Supplying nil will highlight the current date by default.
-
The third argument takes in a function to only allow specific dates in the calendar for selection and disable others.
- Supplying nil will enable all dates for selection.
-
If a function is supplied, it should comply with the following.
- The function should take in three integers: the year, month, and day respectively.
- If the function returns nil, those dates in the calendar will be disabled for selection.
- If the function returns a non-nil value, those dates in the calendar will be enabled for selection.
In the end, the function shall return a list of three integers, in the form of year, month, and day.
Recommended Comments
There are no comments to display.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.