Project

General

Profile

Actions

Feature #14877

closed

Calculate age in Date class

Added by derosm2 (Mike DeRosa) over 6 years ago. Updated over 6 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:87664]

Description

Seems like there's enough complexity in determining the right values and it's something a ton of apps have to address. I've seen a bunch of StackOverflow and other blog posts attempt to address this, not all of them accurately.

Specifically age would calculate the number of years since a person's birthdate (or how old they are).

So if today is 2018, 6, 28:
Date.new(2016, 3, 6).age #=> 2
Date.new(2016, 6, 29).age #=> 1

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0