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

Duration class doesn't contain weeks, months and years #10416

Closed
DartBot opened this issue May 3, 2013 · 5 comments
Closed

Duration class doesn't contain weeks, months and years #10416

DartBot opened this issue May 3, 2013 · 5 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-not-planned Closed as we don't intend to take action on the reported issue

Comments

@DartBot
Copy link

DartBot commented May 3, 2013

This issue was originally filed by svangrieke...@google.com


What steps will reproduce the problem?
The Duration class doesn't contain weeks, months and years.

What is the expected output? What do you see instead?
I would like to have a duration in months, weeks and years.

What version of the product are you using? On what operating system?
Build 22223 on Mac OSx

Please provide any additional information below.
I want to iterate over a list of months given two DateTime instances. The counter should be set with the number of months between these two dates.

@DartBot
Copy link
Author

DartBot commented May 3, 2013

This comment was originally written by svangrieke...@google.com


Area: libraries dart:core

@DartBot
Copy link
Author

DartBot commented May 3, 2013

This comment was originally written by @seaneagan


dupe of issue #1426. this could be part of the library referenced by issue #5627.

@madsager
Copy link
Contributor

madsager commented May 6, 2013

Added Area-Library, Triaged labels.

@lrhn
Copy link
Member

lrhn commented May 6, 2013

The problem with months and years as duration is that they don't always have the same length, or even a reasonable default length. Days have a reasonable 24 hour default length, even if daylight saving makes 23 and 25 occur, but months range between 28 and 31 days, and years between 365 and 366 days,

Duration is really a count of milliseconds (or less), so it's not possible to say how much that is in "months", and even if we had something representing the abstract concept of a "month duration", it's not obvious what would happen if you added that to 2010-01-30 - would you get 2010-02-28, 2010-03-01 or 2010-03-02? All three can be argued.

Weeks (aka. 7 days of 24 hours) should be doable, though.

@floitschG
Copy link
Contributor

Weeks would be possible, but weeks really aren't used that much. Our time-system is based on Year-month-day, hour-minutes-seconds-subseconds.


Added WontFix label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels May 6, 2013
@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue and removed resolution-wont_fix labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-not-planned Closed as we don't intend to take action on the reported issue
Projects
None yet
Development

No branches or pull requests

5 participants