lib/ppcurses/form/date_picker.rb in ppcurses-0.1.1 vs lib/ppcurses/form/date_picker.rb in ppcurses-0.1.2

- old
+ new

@@ -11,12 +11,12 @@ DOWN_ARROW = '∇' # Does the element have focus in the form? attr_accessor :selected + attr_accessor :date - def initialize(label, initial_date = Date.today) @label = label @display_width = 13 @date = initial_date end @@ -69,9 +69,16 @@ @date = @date_menu.day end end + end + + def clear + @date = Date.today + if @date_menu.nil? == false + @date_menu.day = @date + end end #------------------------------------------------ protected def display_string \ No newline at end of file