abdfahim
Well-known member
I have a textbox custom user field to store date (as XF doesn't have any date field yet).
I use regex to force the input in the form of any of the following
However, I would like to store it always in the form of option 1 ("2017-07-05"). One way is to use regex to allow option 1 only, but it would impose an extra restriction to an already annoying practice (not using a calendar).
So, is there any way I can format the user input before saving it to my database?
I use regex to force the input in the form of any of the following
- 2017-07-05
- 2017-7-5
- 05 Jul 2017
- 5 Jul 2017
However, I would like to store it always in the form of option 1 ("2017-07-05"). One way is to use regex to allow option 1 only, but it would impose an extra restriction to an already annoying practice (not using a calendar).
So, is there any way I can format the user input before saving it to my database?