Download
(16 Kb)
Download
Updated: 03/14/23 08:02 AM
Addon for:
LibAddonMenu-2.0.
Pictures
File Info
Compatibility:
Scribes of Fate (8.3.5)
Firesong (8.2.5)
Lost Depths (8.1.5)
High Isle (8.0.0)
Updated:03/14/23 08:02 AM
Created:02/19/21 09:09 AM
Monthly downloads:3,490
Total downloads:158,592
Favorites:32
MD5:
LibAddonMenu - DatePicker widget  Popular! (More than 5000 hits)
Version: 7
by: Baertram [More]
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):
  1. Previous month
  2. Select today and close date picker
  3. Select the month from a dropdown
  4. Select the year by help of the mouse wheel, +/- buttons or enter the year into the editbox
  5. Select the current year
  6. 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:
  1. {
  2.             type = 'datepicker',
  3.             name = GetString(MYADDON_STRING_CONSTANT_DATE_FROM),
  4.             tooltip = GetString(MYADDON_STRING_CONSTANT_DATE_FROM_TT),
  5.             getFunc = function() return settings.dateStart end,
  6.             setFunc = function(dateTimeStampPicked)
  7.                 settings.dateStart  = dateTimeStampPicked
  8.             end,
  9.             width = "full",
  10.             reference = "MYADDON_DatePickerFrom",
  11.         },

GitHub
LibAddonMenu - DatePicker widget

Documentation
[v7 (2022-04-18)]
-Updated API
-Updated dependency version
-Added Spanish translation
-Added Chinese translation



[v6 (2022-04-18)]
-Updated API
-Updated dependency version

[v5 (2021-06-15)]
-Updated API
-Updated RU translations (thanks to ArtemNA)

[v4 (2021-02-22)]
-Updated FR translations (thanks to ImInfenix)

[v3 (2021-02-21)]
-Updated JP translations (thanks to Calamath)
-Updated widget version

[v2 (2021-02-19)]
-Fixed "us" to be the correct "en" language string
-Fixed width of datepicker control headline labels to show the weekdays properly in language en
-Fixed enabled state
Archived Files (6)
File Name
Version
Size
Uploader
Date
6
16kB
Baertram
04/18/22 06:17 AM
5
16kB
Baertram
06/15/21 04:56 AM
4
16kB
Baertram
02/22/21 06:30 AM
3
15kB
Baertram
02/21/21 01:42 PM
2
15kB
Baertram
02/19/21 10:38 AM
1
15kB
Baertram
02/19/21 09:09 AM


Post A Reply Comment Options
Unread 01/06/24, 05:09 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4959
File comments: 6029
Uploads: 78
Oh right, have not thought about en client in non US, many thanks for bringing it to my attention.
If you got the time to provide a patch and settings menu to make us choose the format of the date, I'd be happy.
Currently I do not find the time to work on this myself.

Code should be on github so you could fork it and add it, then send a pull request (if you use Github).
Else send me a pm with a link to your patch and I'll gladly test it.
Last edited by Baertram : 01/06/24 at 05:09 AM.
Report comment to moderator  
Reply With Quote
Unread 01/06/24, 03:13 AM  
SimonIllyan
 
SimonIllyan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 241
Uploads: 2
date format

This widget is great, but I have one complaint: setting date format (Y-M-D vs D.M.Y vs M/D/Y) based on language is probably not the best idea. The M/D/Y format (aka middle-endian abomination) is almost unknown outside of USA. Most of the people who play ESO in English are from other English-speaking countries (United Kingdom and all former British colonies like Ireland, Canada, Australia, New Zealand, India, and big chunk of Africa) or from non-English-speaking countries who have no translation to their own language available (and that means most of Europe), and all of them prefer other formats - see https://en.wikipedia.org/wiki/Date_format_by_country

So, maybe you could add a selector letting the user choose the format? Or at least a parameter to the widget letting the addon using the widget choose, possibly based on previous user choices, like this:
Code:
{
    type = "datepicker",
    dateFormat = "%Y-%m-%d", -- or "%d.%m.%Y", "%d/%m/%y", or whatever else
    …
}
If you have no time for coding that, but would accept a patch, let me know and I will write it. Seeing today's date written as 1/6/2024 really confuses me, and probably thousands of other people…
Last edited by SimonIllyan : 01/06/24 at 03:14 AM.
Report comment to moderator  
Reply With Quote
Unread 02/20/21, 03:16 PM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4959
File comments: 6029
Uploads: 78
Thank you, and thanks for the reminder: Added the github link to the description
Report comment to moderator  
Reply With Quote
Unread 02/20/21, 06:37 AM  
Calamath
AddOn Author - Click to view AddOns

Forum posts: 36
File comments: 220
Uploads: 7
Originally Posted by Baertram
Currently supported languages are EN and DE.
If you are able to provide translations to other languages please do so, here are the strings in English:
I have just sent a pull request to support Japanese mode.
- Calamath
Report comment to moderator  
Reply With Quote
Unread 02/19/21, 09:11 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4959
File comments: 6029
Uploads: 78
Currently supported languages are EN and DE.
If you are able to provide translations to other languages please do so, here are the strings in English:

Code:
["en"] = {
        WEEKDAYS        =   {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"},
        WEEKDAYS_LONG   =   {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"},
        MONTHS          =   {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"},
        MONTHS_LONG     =   {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"},
        CURRENT_DAY     =   "Current day",
        CURRENT_MONTH   =   "Current month",
        CURRENT_YEAR    =   "Current year",
        TODAY           =   "Today",
        NEXT_MONTH      =   "Next month",
        PREVIOUS_MONTH  =   "Previous month",
    },
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.