|
Text mask filter: Date (dd/mm/yyyy)
Input formatter: <?=strtotime({VALUE})?>
Input field html: <input type="text" class="textbox"{NAME_PROP}{MAXLEN_PROP}{WIDTH_PROP_SIZE}{TABINDEX_PROP}{REQUIRED_PROP} value="{VALUE}" id="datepicker" />
Display parsing: plain text
Display format: <?=date('d-m-Y', {VALUE})?>
However I have two problems:
1) The jquery datepicker is being obscured by the message section. I guess this is something to do with some CSS code?
2) When I select a date, it enters it into the textbox like: "18/09/20152015" instead of like "18/09/2015" (which is what I want)
Any ideas whats wrong? Cheers!
For the date picker,yes, the z-index is too low - you need to set it at about 10000 to go over the sceditor
Everything else is the same as nier3 said, but I've made the date order dd/mm/yyyy like I want it to be.
(09-17-2015 06:31 AM)RateU Wrote: [ -> ]Very nice
I just want to add an idea to work also (hopefully) when editing draft and post preview (or when inline post error triggered):
Code:
<if (THIS_SCRIPT == 'editpost.php' && !$mybb->input['my_post_key']) || (THIS_SCRIPT == 'newthread.php' && $mybb->input['action'] == 'editdraft') then><?=date('m/d/Y',{VALUE})?><else>{VALUE}</if>
Also (if not saving it as string), maybe it is better (in my opinion) to set the Underlying Data Type to Integer.
I use pikaday though.
Hi RateU, I tried the code but doesn't work
For now I'm using this:
|
With this the problem still is if user doesn't add a date in the field and I edit (and then save) the thread I have "1970/01/01" date instead of an empty field.
For the rest is ok: if I create a new thread I haven't problem; if I edit a thread with an existent date I have correct date (and not a string like before).
Date in preview post doesn't work
Maybe you can try this condition:
|
The implementation is something like this:
|
|
Other format dates, when I do preview thread or submit thread, it says Invalid value. It works only with Y/m/d
But on showthread the format date is correct, that is dd-mm-yy because in Display Format I use <?=date('d-m-Y', {VALUE})?> so it's a problem only in newthread / edit post, but always better that string of before Not a big problem
And now if I don't add a date and I edit the thread it's perfect, I haven't more 1970-01-01 so it's awesome Thanks
(09-22-2015 09:29 AM)nier3 Wrote: [ -> ]when I do preview thread or submit thread, it says Invalid value. It works only with Y/m/d
Probably because of this:
(09-16-2015 10:25 PM)nier3 Wrote: [ -> ]Text Mask Filter: Custom (regex) and write this: ^((?:19|20)\d\d)/(0?[1-9]|1[012])/(0?[1-9]|[12]\d|3[01])$
I use this Custom (regex) Text Mask Filter:
|
It is based on the default XThreads Date (dd/mm/yyyy) Text Mask Filter.
Custom regex: ^(0?[1-9]|[12]\d|3[01])\-(0?[1-9]|1[012])\-((?:19|20)\d\d)$
Input Formatter: <?=strtotime({VALUE})?>
Input Field HTML:
|
Display format: <?=date('d-m-Y', {VALUE})?>
This custom thread field isn't required.
In the template:
|
I need string number in database for move automatically threads every day on date of expiration:
|