Force date format regex

Discussion in 'Troubleshooting' started by robbyschanilec, Feb 9, 2016.

  1. robbyschanilec

    robbyschanilec New Member

    Joined:
    Feb 9, 2016
    Messages:
    22
    I am having an issue with the date field allowing all sorts of formats. I want to be able to go in and code in some regex to force a format before it is entered into the database. I'm curious if anyone knows what file this is in or of another way of doing it. I don't believe it can be done through the admin panel I'm pretty sure it has to be coded in. Thanks
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,682
    aMember uses date format from choosen locale (aMember CP -> Configuration -> Setup/Configuration -> Languages)

    All dates in database is saved in SQL format (YYYY-MM-DD).

    You can hardcode format in file
    amember/library/Am/Locale.php
    method getDateFormat
  3. robbyschanilec

    robbyschanilec New Member

    Joined:
    Feb 9, 2016
    Messages:
    22
  4. robbyschanilec

    robbyschanilec New Member

    Joined:
    Feb 9, 2016
    Messages:
    22
    How can i change what is shown on the forms? I have a date field but when i select "11/15/1984" it shows up in the user field as "11/15/84" i need to show 4 digit year

Share This Page