/**
A demonstration widget which outputs the server-reported time.
*/
$function(){
// argv.0 === the widget's name
// argv.1 === the rendering options. Frameworks always passes an Object if the client does not.
// Set defaults for options client did not provide:
const opt = this.extendProperties(object{
localTime: false,
timeFormat: "%Y-%m-%d %H:%M:%S",
tzLabel: false
}, argv.1 )
// Generate the output:
opt.label && $this.out opt.label ' '
$this.out strftime(opt.timeFormat, -1, opt.localTime)
opt.tzLabel && $this.out opt.localTime ? ' local' : ' UTC'
}.apply api.cgi api.cgi.renderWidget.renderArgs