Sha256: 605aa02557ad5aa07f2657b9d8c07cc5ce0495fa48c3b38cd45f310c1b782114
Contents?: true
Size: 819 Bytes
Versions: 80
Compression:
Stored size: 819 Bytes
Contents
require 'rubygems' require 'bundler/setup' require 'chronic_duration' module RubyApp module Elements module Inputs require 'ruby_app/elements/input' class DurationInput < RubyApp::Elements::Input template_path(:all, File.dirname(__FILE__)) attr_accessor :duration def initialize super end def duration=(value) @duration = value @value = ChronicDuration.output(@duration) end protected def on_changed(event) @duration = event.value ? ChronicDuration.parse(event.value) : nil @value = @duration ? ChronicDuration.output(@duration) : nil event.update_value("##{self.element_id}", @value) changed(event) end end end end end
Version data entries
80 entries across 80 versions & 1 rubygems