We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39961
    • 25 Posts
    Hi
    I am creating a custom mgr page for bookings so need to use xtype datefields. I have set them up and they are saving into the database correctly but they will not display the current date stored. Any ideas?!

     { xtype: 'datefield',fieldLabel: _('bookings.arrival'),name: 'arrival',format: 'd/m/y',anchor: '48%' }


    The field populates once you select a date but it makes things kind of tricky to not see the current held date!

    Thanks
    Gareth

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

    [ed. note: doglegdesign last edited this post 7 years, 11 months ago.]
      • 39961
      • 25 Posts
      Actually, I was wrong, it wasn't saving the dates! But it is now since I removed the format part:
      { xtype: 'datefield',fieldLabel: _('bookings.arrival'),name: 'arrival',anchor: '48%' }


      Date still not displaying though :-(
      • discuss.answer
        • 39961
        • 25 Posts
        SOLVED!

        I had to set the correct date format going in (i.e. it had to match the DB format:
        { xtype: 'datefield',fieldLabel: _('bookings.arrival'),name: 'arrival', format:'Y-m-d H:i:s',anchor: '48%' }


        Hopefully this may help someone!