Sha256: cb6ee3efd12d670aac02ccfd0d569c9e50574b1f1b2d4c100ba40a4b56bb2301
Contents?: true
Size: 1017 Bytes
Versions: 4
Compression:
Stored size: 1017 Bytes
Contents
module Watir class DateTimeField < Input # # Enter the provided value. # def set!(date) date = ::Time.parse date if date.is_a?(String) message = "DateTimeField##{__callee__} only accepts instances of DateTime or Time" raise ArgumentError, message unless [DateTime, ::Time].include?(date.class) date_time_string = date.strftime('%Y-%m-%dT%H:%M') element_call(:wait_for_writable) { execute_js(:setValue, @element, date_time_string) } end alias set set! alias value= set end # DateTimeField module Container def date_time_field(opts = {}) DateTimeField.new(self, opts.merge(tag_name: 'input', type: 'datetime-local')) end def date_time_fields(opts = {}) DateTimeFieldCollection.new(self, opts.merge(tag_name: 'input', type: 'datetime-local')) end end # Container class DateTimeFieldCollection < InputCollection private def element_class DateTimeField end end # DateTimeFieldCollection end # Watir
Version data entries
4 entries across 4 versions & 1 rubygems