| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function __construct(RawTqContext $context, $selector, $date) |
||
| 21 | { |
||
| 22 | parent::__construct($context, $selector, $date); |
||
| 23 | |||
| 24 | if (null === $this->execute('jQuery.fn.datepicker')) { |
||
| 25 | throw new \RuntimeException('jQuery DatePicker is not available on the page.'); |
||
| 26 | } |
||
| 27 | |||
| 28 | // Drupal 8 will use native "date" field if available. |
||
| 29 | $class = $this->execute('Modernizr && Modernizr.inputtypes.date') ? Native::class : JQuery::class; |
||
| 30 | $this->datePicker = new $class($context, $selector, $date); |
||
| 31 | } |
||
| 32 | |||
| 57 |