Changeset View
Changeset View
Standalone View
Standalone View
src/view/form/control/AphrontFormDateControl.php
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public function readValueFromRequest(AphrontRequest $request) { | ||||
| $err = $this->getError(); | $err = $this->getError(); | ||||
| if ($date || $time) { | if ($date || $time) { | ||||
| $this->valueDate = $date; | $this->valueDate = $date; | ||||
| $this->valueTime = $time; | $this->valueTime = $time; | ||||
| // Assume invalid. | // Assume invalid. | ||||
| $err = 'Invalid'; | $err = pht('Invalid'); | ||||
| $zone = $this->getTimezone(); | $zone = $this->getTimezone(); | ||||
| try { | try { | ||||
| $datetime = new DateTime("{$date} {$time}", $zone); | $datetime = new DateTime("{$date} {$time}", $zone); | ||||
| $value = $datetime->format('U'); | $value = $datetime->format('U'); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| $value = null; | $value = null; | ||||
| ▲ Show 20 Lines • Show All 267 Lines • Show Last 20 Lines | |||||