dox Executable Documentation

Date time field

Render

Given the field new DateTimeField('test')
Given the value is '2001-01-01'
When I render the field
Then the output should be ' <label for="test">Test</label> <input id="test" class="form-control date-time-field" type="text" name="args[test]" value="2001-01-01"/>'
Then it should add array('jquery', 'jquery.datetimepicker') to the head
Then it should add array(' <script> $(\'.date-time-field\').datetimepicker({ format:\'Y-m-d H:i\' }); </script>') to the foot

Inflate

Given the field new DateTimeField('test')
When I inflate '2001-01-01'
Then it should return new \DateTime('2001-01-01')