Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/glimmer-dsl-opal/ext/date.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(*args) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/glimmer-dsl-opal/ext/date.rb', line 46

def new(*args)
  if args.size >= 7
    Glimmer::Config.logger.debug "Dropped timezone #{args[6]} from Time.new(#{args.map(&:to_s)}) constructor arguments since Opal does not support it!"
    args = args[0...6]
  end
  new_original(*args)
end

.new_originalObject



45
# File 'lib/glimmer-dsl-opal/ext/date.rb', line 45

alias new_original new

Instance Method Details

#to_datetimeObject



55
56
57
58
# File 'lib/glimmer-dsl-opal/ext/date.rb', line 55

def to_datetime
  # TODO support timezone
  DateTime.new(year, month, day, hour, min, sec)
end