Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to_date, to_datetime and to_time #2872

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions refm/api/src/date/Date
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ GNU 版にあるような幅指定などもできます。
--- thursday? -> bool
木曜日なら真を返します。

--- to_date -> Date
対応する [[c:Date]] オブジェクトを返します
--- to_date -> self
self を返します

--- to_datetime -> DateTime
対応する [[c:DateTime]] オブジェクトを返します。
Expand Down Expand Up @@ -822,5 +822,5 @@ XML Scheme (date) による書式の文字列を返します。
--- to_datetime -> DateTime
対応する [[c:DateTime]] オブジェクトを返します。

--- to_time -> Time
対応する [[c:Time]] オブジェクトを返します
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

元の説明であっているようです。

% ruby -r date -e 'd = Date.today; p [d.to_time.class, d.equal?(d.to_time)]'
[Time, false]

--- to_time -> self
self を返します
9 changes: 9 additions & 0 deletions refm/api/src/date/DateTime
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,12 @@ self を複製して、その時差を設定しなおします。
--- second_fraction -> Rational
#@end
秒の小数点以下の部分を表す分数を返します。

--- to_date -> Date
対応する [[c:Date]] オブジェクトを返します。

--- to_datetime -> self
self を返します。

--- to_time -> Time
対応する [[c:Time]] オブジェクトを返します。