Sha256: 688d6ec001b111fca6cc64a5a4ea1e070044b45fc7628757082cefc0b85614d7
Contents?: true
Size: 1 KB
Versions: 3
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true module Watir class DateField < Input # # Enter the provided value. # def set!(date) date = Date.parse date if date.is_a?(String) message = "DateField##{__callee__} only accepts instances of Date or Time" raise ArgumentError, message unless [Date, ::Time].include?(date.class) date_string = date.strftime('%Y-%m-%d') element_call(:wait_for_writable) do execute_js(:setValue, @element, date_string) execute_js(:fireEvent, @element, :change) end end alias set set! alias value= set end # DateField module Container def date_field(opts = {}) DateField.new(self, opts.merge(tag_name: 'input', type: 'date')) end def date_fields(opts = {}) DateFieldCollection.new(self, opts.merge(tag_name: 'input', type: 'date')) end end # Container class DateFieldCollection < InputCollection private def element_class DateField end end # DateFieldCollection end # Watir
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
watir-7.2.2 | lib/watir/elements/date_field.rb |
watir-7.2.1 | lib/watir/elements/date_field.rb |
watir-7.2.0 | lib/watir/elements/date_field.rb |