Forums » SEPHP Feature Requests

Date Profile Field Year max = current year

  • gs
    • 861 posts
    August 2, 2017 9:53 PM EDT

    What are the steps to reproduce this issue?  Create a Date profile field and attempt to edit the year.

    … … …

    What happens?  The list of years runs from 1918 - 2017.

    What were you expecting to happen?  Year choices in the list beyond current year.  A setting in ADMINcp would be useful for start/end dates (or display a calendar for date selection or allow typical date entry using system format of MM/DD/YYYY or YYYY/MM/DD or whatever the ADMIN's desired format is). 

    Any logs, error output, etc?  No logs or error output, but screenshot is below.

     

     

    Any other comments?  I can't believe this   I just tested in various versions of 4.8.xx with the same results.  The reason I never noticed this before is that any dates I've required were part of customizations which required selecting from a displayed calendar.  Now when I mentioned this bug to another Dev in their software, they mentioned it is fault of SE because that's what SE does.  So, I thought to myself - this can't be.  Why allow Date fields that max out with the current year (it's a generic date field, not a specific DOB which can't be in the future).  Well, come to find out - the Dev was correct - this is the default for SE - no years beyond the current year.  If I missed something somewhere (I even double-checked the linked KB article), please accept my apologies and explain how I can resolve this issue.

    What versions of software are you using?  Not sure what 'software' you're referring to. 

    Operating System: …  Windows 7 and Android 6.x (or are you referring to the Server OS?)

    SocialEngine PHP Version: … 4.09.02


    This post was edited by gs at August 2, 2017 10:00 PM EDT
    • Moderator
    • 4210 posts
    August 3, 2017 6:35 AM EDT

     

    I'll move this to feature requests. It seems a good feature if possible.

  • gs
    • 861 posts
    August 3, 2017 9:58 AM EDT
    FR? This isn't a bug? Am I really the first or only user that created a Date profile field that requires dates after this year?
    I'm not being mean - just shocked that this is actually the way the software is supposed to work, to limit profile dates to this year or prior.
    Unless SE fixes this soon it will cost $400 for a Dev to fix. I just can't believe this one
  • gs
    • 861 posts
    September 22, 2017 1:22 PM EDT

    Since Profile Fields are being worked on for v4.10, is it possible to include this as well as it simply doesn't make sense to lock dates into <= Current Year.  I'm still surprised SE doesn't consider this a bug.  If the Date Calendar can scroll into the future then a Profile Field should allow future years too - which is why (IMHO) this is an oversight, not a planned limitation.

    • 154 posts
    September 23, 2017 10:55 AM EDT

    I raised this years ago via email.

    When I was building a site for someone using social engine for a crafts type network.

    There was some users who were over 100 years old in some countries who did knitting stuff.

    This was like 3 years ago. I assumed was fixed!

  • gs
    • 861 posts
    September 25, 2017 12:31 AM EDT
    I don't know why we can't just have a date entry field w/o being fancy about it. yyyy/mm/dd or whatever format is selected by ADMIN. Drop-downs and scrolling calendars look nicer, but what good is that when you can't enter the date you want to. I'm not familiar with other scripts, but in over 3 decades I've never not been able to enter a date into any software except this. smh
    • 154 posts
    September 27, 2017 4:16 PM EDT

    I really miss github

    • Moderator
    • 4210 posts
    September 28, 2017 7:16 AM EDT
    gs said:
    I don't know why we can't just have a date entry field w/o being fancy about it. yyyy/mm/dd or whatever format is selected by ADMIN. Drop-downs and scrolling calendars look nicer, but what good is that when you can't enter the date you want to. I'm not familiar with other scripts, but in over 3 decades I've never not been able to enter a date into any software except this. smh

    Had the same issue at that other script I was at. Using default date programming. We'll have to look at this for solutions.

  • gs
    • 861 posts
    September 28, 2017 3:51 PM EDT

    ==>"...We'll have to look at this for solutions...."

    Thanks @Donna.  I'm not as familiar with other scripts as SE (which I'm still no expert at) but having another script with the same silly issue means at least 2 Companies released products without thinking this through - a date is a date.  If someone want's to verify if the date is prior-to or after-today, that's a separate issue.  What surprises me is that in all these years no User has ever had to enter a date after 'this year' or wanted ot simply enter a date in 'normal' format without picklists/drop-downs, etc.  Since I first begain with computers in the early 80s, there was always a way to enter a date with dashes or slashes, until SE (and 'that other script').  Anyhoooo, hopefully SE will address this with the upcoming profile changes as the inability to enter a date kinda sorta makes some things very difficult   You should see the look from a client when they say 'what, you can't enter a date?  what system doesn't allow you to enter a date?'. 

    • Moderator
    • 4210 posts
    September 29, 2017 6:58 AM EDT

    To do this yourself requires a core change. This is overwritten on upgrades and is best done via plugins instead. Clear cache after. This is not any official improvement or official recommendation. Just providing it to help for those that might need it now.

    Find file application/libraries/Engine/Form/Element/Date.php

    around line 126 edit it to add whatever amount you want as seen below I added 100

     

    // Default is this year if( is_null($this->_yearMax) ) { $date = new Zend_Date(); $this->_yearMax = (int) $date->get(Zend_Date::YEAR) + 100; } return $this->_yearMax; }
    This post was edited by Donna at September 29, 2017 6:59 AM EDT
    • 154 posts
    September 29, 2017 8:08 PM EDT

    Niiiiiiiiiiiiiiiiiiiiiiiice thanks @donna

  • gs
    • 861 posts
    September 29, 2017 9:54 PM EDT

    yes, thanks very much

    I don't mind doing core chgs when they are easy and short like this (or a few lines).  Now @Daniel you'll have to see if there's a yearMin or similar in order to enter those old bdays.

    • Moderator
    • 4210 posts
    September 30, 2017 5:35 AM EDT

    You're welcome. I forgot you wanted yearMin. It's right above the Max. Just change the - 100 to whatever you want.