Skip to content

Commit

Permalink
Change how the current set date is evaluated
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Nocon authored and tischsoic committed Mar 19, 2019
1 parent 556a7e6 commit d43866b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/Behat/PageElement/DateAndTimePopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public function setTime(string $hour, string $minute): void

if (!$isTimeOnly) {
// get current date as it's not possible to set time without setting date
$currentDateScript = sprintf('document.querySelector("%s %s")._flatpickr.formatDate(document.querySelector("%s %s")._flatpickr.selectedDates, "Y-m-d")',
$this->fields['containerSelector'],
$this->fields['flatpickrSelector'],
$currentDateScript = sprintf('document.querySelector("%s %s")._flatpickr.selectedDates[0].toLocaleString()',
$this->fields['containerSelector'],
$this->fields['flatpickrSelector']);
$currentDate = $this->context->getSession()->getDriver()->evaluateScript($currentDateScript);
Expand Down

0 comments on commit d43866b

Please sign in to comment.