Popup Calendar - Removing seconds

I am working with several popup calendar components and want to remove the seconds portion. I have the Format string set as yyyy-MM-dd HH:mm and that shows up how I like. However when click the down arrow to launch the calendar, the seconds are there. Is it possible to customize the component in this way?

I am using this as part of a data entry form and the customer would rather not have to deal with the seconds.


1 Like

There is the “Show Time” property of the Popup Calendar, does setting that to false solve your issue? I can’t pull up Ignition atm to check myself.

Failing that, you could always just set the seconds to zero when you parse it for the data entry…

Setting “Show Time” to false removes hours minutes and seconds from the popup. I still need the Hours and minutes.


I’d either get rid of the seconds when you need to read the value (when the user hits submit?) or right when they change the date.

You can put this in the PUC propertyChange event script:

if event.propertyName == 'date':
	date = event.newValue
	seconds = system.date.getSecond(date)
	event.source.date = system.date.addSeconds(date, -seconds) 

use this script in ‘internalFrameActivated’ to accomplish this:

system.gui.getParentWindow(event).getComponentForPath(‘Root Container.Calendar’).getTimeSelector().setTimeFormat(“HH:mm aa”)

to test this script, you can open this window in the client

This works for the Calendar component, but not the popup calendar.