Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 5 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)

5464.patch (1.2 KB) - added by bi0xid 6 years ago.
Changing max year to current year in datebox
5464.2.patch (656 bytes) - added by bi0xid 6 years ago.

Download all attachments as: .zip

Change History (5)

@bi0xid
6 years ago

Changing max year to current year in datebox

@bi0xid
6 years ago

#1 @DJPaul
6 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 @boonebgorges
6 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.

#3 @DJPaul
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I am closing this as a duplicate of #5500 as they're pretty similar, and we need to figure out what we're going to do, as Boone and I seem to have strong opposing opinions. :)

Note: See TracTickets for help on using tickets.