I think I'm almost there with this one but obviously missing something as the postDate is not updating. I have the following in an onSaveEntry event. It's saying it's successful but the postDate does not change. Ideally I want this to update whether the entry is enabled or not.
public function onSaveEntry(Event $event)
{
$entry = $event->params['entry'];
// set postDate from assignedDate
if($user->admin) {
if($entry->assignedDate && $entry->assignedTimeslot) {
$timeslot = $entry->assignedDate.' '.$entry->assignedTimeslot.'.000000';
$params = $entry->postDate = $timeslot;
$success = craft()->elements->saveElement($entry, $params);
}
}
return $event;
}
assignedDateTime
which can take a date and a time. This can then be used to set the postDate. Why has the timeslot got'.00000'
after it?