Comments (6)
I believe that test case is incorrect. Per https://www.timeanddate.com/date/dateadded.html?m1=02&d1=20&y1=2019&type=add&ay=2&am=&aw=&ad=6&rec= the correct value was returned. When you add years, you do not convert them to days, you just add years. Does it reproduce when starting with Feb-1 and adding 31 days or Feb-28 00:00 and adding 25 hours?
from calculator.
This is your friendly Microsoft Issue Bot. I created this issue automatically as requested by a team member.
from calculator.
I agree with @benjaminkwilliams. I think it should be asked what does the user expect when a year is added to a date, if the next day in the next year or the 365th next day. I find it more likely to be the first one. Otherwise, the answer for adding y years to a date month/day/year would be month/day - leap years in that period of time/year+y, and saying that 20 years after 02/20/2019 is 02/15/2039 sounds odd to me.
However, if we stick to the definition of adding a year that Benjamin and I propose, it would be still needed to define what date is a year after any February 29th.
from calculator.
I agree with @benjaminkwilliams and @marcomontoya, a year is not defined as 365 days neither as "Earth doing a full loop around the sun (~365.24219 days)", but as the same the same day number and month but Year+1.
We should also keep in mind that the Calculator application manages more than the Gregorian calendar.
Think about birthdays or anniversaries, you don't celebrate your birthday 1 day before before the current year was a leap one.
from calculator.
I concur, the calculator is behaving correctly. It is indeed taking leap years into account, by not treating a year as 365 days. This is akin to not every month being 30 days.
In both cases, the calculator is doing the correct thing.
- Consider March 31st (of any year) plus one month. The result cannot be April 31st, because April only has 30 days. So the result becomes April 30th.
- Advancing to May 1st would not make sense in most cases - as we started in March so expected to end in April.
- Now consider February 29th 2020 plus one year. The result cannot be February 29th 2021, because in that year February only has 28 days. Thus, the result is February 28th 2021.
- Advancing to March 1st 2021 would not make sense in most cases - as we started in February so expected to end in February.
The issue should be closed. Thanks.
from calculator.
Closing per conversation above.
from calculator.
Related Issues (20)
- How to remove fucking spaces from this calculator or return to windows 7 verison. HOT 2
- space
- Wrong result in the win 11 calculator HOT 2
- Calculator Does Not Support Multiplying By Negative Numbers
- Using '%' in Standard Calculator Clears Input HOT 1
- Multiple Currency Conversion
- Calculator crashes if you zoom to far out on the Graphing Page
- Ja
- Ja
- [Localization]
- SWIPE DELETE FUNCTION FREEZES APP
- Wrong icon of calculator
- Disable scientific notation
- Programmer calculator treats MSB as sign bit, no option to remove sign bit
- Can you set a button for the top function in all (scientific) modes
- Is it possible to add an option that allows you to restore the history even after closing the application and opening it again? HOT 1
- "about equal to" feature in the volume calculator/converter
- Constant ratio of units on the axes
- [Localization] [zh-CN] Incorrect translations in Currency
- Disabling the Clipboard User Service causes Calculator to crash when copying values or pressing CTRL+C
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calculator.