Opened 11 years ago
Closed 11 years ago
#5646 closed enhancement (duplicate)
Max date for datebox should be present year
Reported by: | bi0xid | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | |
Component: | Extended Profile | Keywords: | has-patch |
Cc: |
Description
Hello there.
I have been working with dateboxes and I'm always amazed with 2037 as max date. Does it have a reason?
BTW, datebox is used in the extended profile, and you are not supposed to have future things in your profile. Right now I can only think about expiration dates of something (memberships, credit cards) to need a max date over the current year, and still sound me a bit strange in the user profile.
I'm proposing to change max date to the current year, as this is the most common thing that users awaits when they use the datebox, usually for date of birth or date or first register.
Attachments (2)
Change History (5)
#1
@
11 years ago
Take a look at #2946 which explains why the date goes into the future, yet caps at 2037. It's possible versions of PHP later than 5.1 support calculating years beyond 2038, but it's a little vague from that page -- I haven't tested since about three years ago ;)
What I think you really want is a "date of birth" field type rather than a "datebox" field type; we can't change the maximum value for the datebox field type without breaking existing use of this field.
Now that it's pretty easy to add new profile field types since BP 2.0, my feeling is that we'd be OK with adding a new "date of birth" field type. Fancy working on a patch? Take a look at the recent patches on #5501 for an example of how to add a new field type.
#2
@
11 years ago
IMO, a DOB field type borders on the too-specific. See my alternative proposal in #5500 https://buddypress.trac.wordpress.org/ticket/5500#comment:1 - adding the options to set upper and lower bounds to the existing Date field type.
Changing max year to current year in datebox