chansen / p5-time-moment

Time::Moment represents an exact moment in time.
32 stars 8 forks source link

to_string doesn't accept reduced option #39

Open srchulo opened 5 years ago

srchulo commented 5 years ago

I've tried to get a reduced string as mentioned in the documentation:

my $time = Time::Moment->now->to_string([reduced => 1]);

But I get this error:

Odd number of elements in named parameters

I've also tried

my $time = Time::Moment->now->to_string(reduced => 1);

and

my $time = Time::Moment->now->to_string(1);

And those do not work either.

chansen commented 1 year ago

Could you please please provide me with a reproducible test case?

srchulo commented 1 year ago

It looks like the documentation is wrong. [reduced => 1] should be reduced => 1

chansen commented 1 year ago

Parameters enclosed in the [ and ] notation are optional and can be omitted. I have tried to use this notation consistently in Time::Moment where the value of the named parameter shows the default.

This report relates to #20.