This question has been answered by chrisderover. See the first response.
// /manager/assets/modext/widgets/resource/modx.panel.resource.js line 586
{
xtype: MODx.config.publish_document ? 'xdatetime' : 'hidden'
,fieldLabel: _('resource_publishdate')
,description: '<b>[[*pub_date]]</b><br />'+_('resource_publishdate_help')
,name: 'pub_date'
,id: 'modx-resource-pub-date'
,allowBlank: true
,dateFormat: MODx.config.manager_date_format
,timeFormat: MODx.config.manager_time_format // something here maybe??
,startDay: parseInt(MODx.config.manager_week_start)
,dateWidth: 120
,timeWidth: 120
,value: config.record.pub_date
}
<?php
$template = $resource->get('template'); //get template id
$unpubdate = $resource->get('unpub_date'); //get current unpub_date
if ( !empty($unpubdate) && $template == 11 ) { //only execute when an unpub_date has been entered AND the resource has the desired template
$date = new DateTime($unpubdate);
$date->setTime(9, 00, 00); //set desired time
$newDate = $date->format('Y-m-d H:i:s');
$resource->set('unpub_date', $newDate);
$resource->save();
}/* Only execute when an unpub_date has been entered AND the resource has the desired template */
if ( empty($unpubdate) || $template != 11 ) {
return;
} else {
$date = new DateTime($unpubdate);
$date->setTime(9, 00, 00); //set desired time
$newDate = $date->format('Y-m-d H:i:s');
$resource->set('unpub_date', $newDate);
$resource->save();
}