We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Hi,

    The age and birthdate function in MODX is a little buggy, and I am wonding what can be done about it. The default is 44, for some strange reason.

    I put birthdate into registration, but it doesn't lead to any improvement, and I don't know why. The age is calculated from birthdate, and in the modx forums, when I add in my birthdate in update profile, it calculates properly.

    What's so strange is that once I included birthdate in registration, it is treated as an extended field, even though that field should be considered as a normal field. I thought maybe the name of the field is different, but I don't think that is so.

    Anyone know about this problem? Its not the end of the world, but its a little annoying that the age won't be right even though they have inputed their birthdate, and I don't want them to be able to update this info to be honest. I just want the age calculation to work if possible.

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      The name of the birthdate field is 'dob' and it is in the User Profile object, not the User Object. That could be your problem.

      There is also some conversion going on that you might need to know about. http://bobsguides.com/blog.html/2013/09/18/displaying-modx-date-fields/
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 46886
        • 1,154 Posts
        Ah thank you so much, this is quite useful, by the way I notice you updated the style on Bob's Guides, looking good!

        Your link is very helpful, and incidentally seems related to another small bug in Discuss, where date registered doesn't appear in the profile, the code must be wrong somehow. I just filed a bug report on that, maybe I can provide a fix based on the information you provided. Thanks!
          • 46886
          • 1,154 Posts
          And I was able to fix that bug in Discuss! Cool! The code is [[*createdon:strftime=`%A %B %d, %Y'`]] rather than [[+createdon:strtotime:date=%b %d, %Y]]
            • 3749
            • 24,544 Posts
            Glad I could help.

            You were looking at the style of the Blog (mostly the default Articles design), the rest of Bob's Guides is its traditional ugly self.

            It's my way of preventing people from trying to hire me to design web sites. wink

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 46886
              • 1,154 Posts
              Haha that would be a waste of your skills.

              I am still trying to get to the bottom of this age thing, will put up a new post to try and home in on the important info.