The calendar.visible property is also affected by the Calendar:show() and Calendar:hide() methods.
Calendar.visible read/write property
Get or set the calendar visibility on screen, a true value means that the Calendar is shown, a false value means that the Calendar is hidden.
Example
local ui = require "ui"
-- create a simple calendar
local win = ui.Window("Calendar.visible sample", 320, 220)
local calendar = ui.Calendar(win, 50, 40)
local button = ui.Button(win, "Click to hide calendar", 100, 10)
calendar.font = "Impact"
calendar.fontsize = 24
function button:onClick()
-- hides the calendar
calendar.visible = false
button.enabled = false
-- and shows it again after 2 sec
async(function()
sleep(2000)
button.enabled = true
calendar.visible = true
end)
end
-- update the user interface until the user closes the Window
ui.run(win):wait()