LibAddonMenu - DatePicker widget
A DatePicker widget for the library
LibAddonMenu.
Just install it in addition to LibAddonMenu-2.0 (release 32 or newer is needed!) and use the new widget type "datepicker" in your addon'
settings panel.
Add to your manifest txt file:
Code:
## DependsOn: LibAddonMenuDatePicker
This widget is based on a combobox with dropdown and will show the datepicker as you click the combobox or the "open dropdown" arrow.
The picked date will be saved as a UNIX timestamp (same format like GetTimeStamp() provides) with the selected date and time 00:00:00 (midnight).
Description of the bullet points 1 to 6 (see image 1 of this addon):- Previous month
- Select today and close date picker
- Select the month from a dropdown
- Select the year by help of the mouse wheel, +/- buttons or enter the year into the editbox
- Select the current year
- Next month
Provides the following parameters:
Code:
--[[datepickerData = {
type = "datepicker",
datePickerType = "normal", -- (optional)
name = "My Datepicker", -- or string id or function returning a string
getFunc = function() return db.var end,
setFunc = function(var) db.var = var doStuff() end,
tooltip = "Datepicker's tooltip text.", -- or string id or function returning a string (optional)
width = "full", -- or "half" (optional)
disabled = function() return db.someBooleanSetting end, -- or boolean (optional)
warning = "May cause permanent awesomeness.", -- or string id or function returning a string (optional)
requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
default = defaults.var, -- default value or function that returns the default value (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonDatepicker" -- unique global reference to control (optional)
} ]]
Example usage in a LAM settings panel:
Lua Code:
{
type = 'datepicker',
name = GetString(MYADDON_STRING_CONSTANT_DATE_FROM),
tooltip = GetString(MYADDON_STRING_CONSTANT_DATE_FROM_TT),
getFunc = function() return settings.dateStart end,
setFunc = function(dateTimeStampPicked)
settings.dateStart = dateTimeStampPicked
end,
width = "full",
reference = "MYADDON_DatePickerFrom",
},
GitHub
LibAddonMenu - DatePicker widget
Documentation