# Perspective Table View Date Picker

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-view-date-picker/78589>\
**Category:** Ignition\
**Tags:** perspective, vision\
**Created:** [August 30, 2023, 10:15pm UTC](https://forum.inductiveautomation.com/t/perspective-table-view-date-picker/78589 "2023-08-30T22:15:22Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Andrew\_Buldyzhov](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew_buldyzhov/32/74246_2.png) [@Andrew\_Buldyzhov](https://forum.inductiveautomation.com/u/Andrew_Buldyzhov)\
**Post date:** [March 27, 2025, 9:33am UTC](https://forum.inductiveautomation.com/t/perspective-table-view-date-picker/78589/9 "2025-03-27T09:33:08Z")

</div>

@amy.sudibyo, thank you for the explanation. Below are my scripts which I developed accordingly (also thanks to [this article](https://forum.inductiveautomation.com/t/table-cell-change-to-date-and-time-picker/100785)).

View \> DateTimeInput \> value \> Edit Change Script:

```python
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
		
	from java.text import SimpleDateFormat
	
	value = currentValue.value
	if (value is not None) and ('Binding' not in str(origin)):
		
		date_format = SimpleDateFormat('yyyy-MM-dd')
		formatted_date = date_format.format(value)
		rowIndex = self.view.params.rowIndex
		column = self.view.params.column
		
		msg = 'UpdateTableCell'
		payload =	{
					'value'	: formatted_date,
					'rowIndex': rowIndex,
					'column': column
					}
		system.perspective.sendMessage(msg, payload)

```

Table \> Configure Events \> onEditCellCommit:

```python
def runAction(self, event):

	msg = 'UpdateTableCell'
	payload =	{
			'value'	: event.value,
			'rowIndex': event.row,
			'column': event.column
			}
	system.perspective.sendMessage(msg, payload)

```

Table \> Configure Scripts \> Message Handlers \> UpdateTableCell:

```python
def onMessageReceived(self, payload):

	value = payload['value']
	rowIndex = payload['rowIndex']
	column = payload['column']

	dbTable=self.custom.dbTable
	id = self.props.data.getValueAt(rowIndex,'id')
	query = "UPDATE %s SET %s = '%s' WHERE id = %d" % (dbTable, column, value, id)
	system.db.runUpdateQuery(query)
#	system.perspective.print(query)
	
	self.refreshBinding("props.data")

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-table-view-date-picker/78589)._
