UI.Calendar

From GiderosMobile
Revision as of 07:18, 17 October 2023 by MoKaLux (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)