Difference between revisions of "UI.Calendar"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2023.1<br/> '''Class:''' UI<br/> === Description === Creates Calendar widgets. The widget can be a '''Calendar''' or a '''DatePic...") |
|||
Line 9: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | === Examples === |
'''A Calendar''' | '''A Calendar''' | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 02:55, 15 October 2023
Available since: Gideros 2023.1
Class: UI
Description
Creates Calendar widgets. The widget can be a Calendar or a DatePicker.
UI.Calendar.new()
Examples
A Calendar
local gui = UI.Calendar.new()
gui:setPosition(50, 50)
stage:addChild(gui)
--local myday = os.time()
local myday = os.time({year=2003, month=7, day=14, hour=8, min=10, sec=0,})
gui:setDate(myday)
local mydate = os.date("*t", gui:getDate())
print(mydate.month)
print(gui.month) -- shorter
A DatePicker
local gui = UI.DatePicker.new()
gui:setPosition(50, 50)
gui:setDate(os.time({year=2003, month=8, day=14, hour=8, min=10, sec=0,}))
print(gui:getDate())
local screen=UI.Screen.new() -- needed to add the calendar
screen:ui(gui)