Alpha Video Training
Results 1 to 10 of 10

Thread: Date Picker, Enter Year 2020 but Saves as Year 1920!

  1. #1
    Member
    Real Name
    Steve Hood
    Join Date
    Dec 2007
    Posts
    19

    Default Date Picker, Enter Year 2020 but Saves as Year 1920!

    Hi Folks,

    Maybe someone out there can help.

    We have a website running on Alpha Web App Server.

    When we enter a date with a year of 2020 into a Grid using the "Date/Time Picker" the Year is stored in the DB as 1920, not 2020. Enter 2019 and it works perfect.

    Any ideas? Perhaps a property setting?

    Cheers,
    Steve

  2. #2
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,396

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!


  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,812

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    Are you entering 2 digit years?
    What is the Date format being used?
    What is the Date format set to in the Grid Properties Miscellaneous section?

    Check the "Switch year" property - it's in the Date/Time Picker Properties. By default it is set to 20.

    Also check the Grid Property... "Switch year" under the Miscellaneous section. It's default is empty... which means use a default value of 30.

    If your Date Picker is set to use a 2 digit year, then the Date Picker should be showing 1920 as well.

    My Grid Miscellaneous Date format is set to MM/dd/yyyy... and Switch Year is empty.
    My field Date format is set to <DefaultDateformat> which will pick up the Grid Date format.
    Because a 4 year date is being used, the Switch year does not get used.

    If you're using a 2 digit year in your date formats, then the Switch year will get used.

  4. #4
    Member
    Real Name
    Steve Hood
    Join Date
    Dec 2007
    Posts
    19

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    Hi Davidk,

    Your advice to set the year to 4 digits did the trick!! THANK YOU VERY MUCH!! :)

    Steve

  5. #5
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,412

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    How do you do this in bulk? I have 1900 components that I potentially have to fix. This is brutal!
    Chad Brown

  6. #6
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,412

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    I have added the following to my users login redirect page and it seems to work for everywhere I have checked so far.

    session.__protected__clientSideDateFormat = "MM/dd/yyyy"

    Most likely it doesnt need the __protected__ but it works anyways.
    Chad Brown

  7. #7
    Member 411tech's Avatar
    Real Name
    Barry Kucher
    Join Date
    Jul 2006
    Posts
    200

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    Starting 1/1/2020 if you have an older website, dates might not work correctly anymore. You most likely left the default action for Date Translation for 2 year dates to end in 2020. If you don't change the definition higher than 20, starting yesterday, if someone enters a date as 1/1/20, Alpha will assume the date YEAR is 1920.

    There are a few different locations that you will have to change the default year for the 2020's.

    Such as:
    The 'View' menu, 'Settings', 'Date' - Change the Two digit dates between 00 and (change the 20 to 40) are assumed to be in the 21st century.
    In a grid/UX and possibly others components, Component Properties, Miscellaneous Section, change the format to MM/dd/yyyy and change the switch year to 40.
    In the Search & DETAIL View Properties that have date parameters you must go into each date field, Miscellaneous Section, change the Display format to MM/dd/yyyy to avoid the issue.
    ETC...

    Hope this helps.

    ---------------------------------------------------
    Barry Kucher
    http://www.411tech.org

  8. #8
    "Certified" Alphaholic chadbrown's Avatar
    Real Name
    Chad Brown
    Join Date
    Aug 2007
    Location
    Aurora, Ontario, Canada
    Posts
    1,412

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    My solution above is working and I have not had to change any of the other settings. But thanks.
    Chad Brown

  9. #9
    Member compuaid's Avatar
    Real Name
    Brad Weaver
    Join Date
    Aug 2007
    Location
    Ottawa, ON
    Posts
    385

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    I have several UX components that use date picker date fields. I have checked and all UX components are set to four digit year format, changed the switch year in Other Properties to 40, and the switch year in the Date/Time picker properties on each control to 40. When a user enter 01/10/20 for instance, the system records the date as 01/10/1920. This is already causing some major headaches as data is getting entering incorrectly. I also tried adding session.__protected__clientSideDateFormat = "MM/dd/yyyy" to my server-side OnDialogInitialize and no joy.

    Any thoughts or has anyone else successfully gotten Alpha to recognize 01/01/20 as 01/01/2020 in UX components?
    Brad Weaver, President
    ComputerAid International
    Ottawa ON Canada
    Versailles KY USA
    www.compuaid.com

  10. #10
    "Certified" Alphaholic mikeallenbrown's Avatar
    Real Name
    Mike Brown
    Join Date
    Nov 2009
    Location
    United States
    Posts
    1,899

    Default Re: Date Picker, Enter Year 2020 but Saves as Year 1920!

    I had this issue in one of my UX's (web app running 6348). I discovered that, in the Date/Time Picker Properties, my date format was MM/dd/yy 0h:0m AM. I actually wanted a four digit year and after changing the yy to yyyy the problem was solved for me.

    By the way, one of the pre-releases after 6348 fixed the issue. It's in the prerelease notes.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant

Similar Threads

  1. Report with Daily, Month-to-Date, Year-to-Date Totals
    By Dfred in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 04-19-2012, 03:19 PM
  2. Date Picker - dynamic year
    By Steve Wood in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 09-25-2010, 10:30 AM
  3. How do you separate Year 2009 from Year 2010
    By Davidafp in forum QReportBuilder
    Replies: 6
    Last Post: 01-05-2010, 12:39 AM
  4. Year from Date Question
    By Scott_S in forum Alpha Five Version 8
    Replies: 14
    Last Post: 10-23-2008, 05:19 AM
  5. Year to Date solution
    By skyk in forum Alpha Five Version 6
    Replies: 0
    Last Post: 05-31-2007, 10:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •