You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
I would like to know what type of object to expect when we call to_date method on DateTime object.
I was hoping that will be ISO8601::Date object but seeing some different results.
For instance if I call new on Date object "ISO8601::Date.new('2014-05-02')" I can call weeks method on it and returns correct results but I do same with DateTime class and to_date method get an error
2.1.5 :001 > require 'iso8601'
=> true
2.1.5 :002 > ISO8601::Date.new('2014-W05').week
=> 5
2.1.5 :003 > ISO8601::DateTime.new('2014-05-02').to_date.week
NoMethodError: undefined method `week' for #<Date: 2014-05-02 ((2456780j,0s,0n),+0s,2299161j)>
from (irb):3
from /Users/DR029931/.rvm/rubies/ruby-2.1.5/bin/irb:11:in `<main>'
Just wanted some clarification for my understanding.
The text was updated successfully, but these errors were encountered:
I would like to know what type of object to expect when we call to_date method on DateTime object.
I was hoping that will be ISO8601::Date object but seeing some different results.
For instance if I call new on Date object "ISO8601::Date.new('2014-05-02')" I can call weeks method on it and returns correct results but I do same with DateTime class and to_date method get an error
Just wanted some clarification for my understanding.
The text was updated successfully, but these errors were encountered: