Project

General

Profile

Actions

Feature #14550

open

Support keyword arguments with Date#step

Added by ksss (Yuki Kurihara) almost 7 years ago. Updated almost 7 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:85798]

Description

How about supporting keyword arguments with Date#step like Numeric#step?

from = Date.new(2018, 1, 1)
to = Date.new(2018, 2, 1)
from.step(to: to, by: 3).to_a

I expected that this is already supported.
But not.


Files

date-step.patch (2.8 KB) date-step.patch ksss (Yuki Kurihara), 02/24/2018 02:34 PM
date-step-2.patch (3.46 KB) date-step-2.patch ksss (Yuki Kurihara), 02/25/2018 08:35 AM

Updated by shevegen (Robert A. Heiler) almost 7 years ago

Seems ok.

For others, here is a quick link to the documentation for Date
in current ruby 2.5.0:

http://ruby-doc.org/stdlib-2.5.0/libdoc/date/rdoc/Date.html#method-i-step

Updated by ksss (Yuki Kurihara) almost 7 years ago

Thank you for reviewing.
I updated the documentation for Date#step also. (date-step-2.patch)

Updated by avit (Andrew Vit) almost 7 years ago

If adding keyword options, would it make sense to add the possibility to enumerate by >> for whole months instead of only succ days, or is that out of scope here?

Updated by duerst (Martin Dürst) almost 7 years ago

avit (Andrew Vit) wrote:

If adding keyword options, would it make sense to add the possibility to enumerate by >> for whole months instead of only succ days, or is that out of scope here?

Please write a separate feature describing your proposal in more detail. You can link to this feature if you think it's related.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0