Last modified: 2011-03-13 18:06:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29957, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27957 - User can leave date part empty with datetimepicker
User can leave date part empty with datetimepicker
Status: CLOSED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
SemanticFormsInputs (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: s7eph4n
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-09 10:18 UTC by Patrick
Modified: 2011-03-13 18:06 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Patrick 2011-03-09 10:18:51 UTC
I have a couple of 'input type=datetimepicker' fields in forms - they all have in common, that just entering a time is inacceptable - there can be just a date and no time, or both filled in, but not just a time.
datetimepicker happily accepts that though, and saves 'TemplateParameter= hh:mm' (hh:mm being the time entered) when I submit the form.
Would it be possible to somehow disallow entering just a time with datetimepicker, or at least warn the user?
Comment 1 s7eph4n 2011-03-09 10:24:07 UTC
There is nothing like dateonly or datemandatory.

You can set the whole input to mandatory, but that would require both date and time field to be set, i.e. it is not possible to leave the time field empty.

You could also combine the datetimepicker with a regexp input.
Comment 2 Patrick 2011-03-11 07:09:54 UTC
(In reply to comment #1)
> You could also combine the datetimepicker with a regexp input.

Thanks for bringing the regexp input to my attention, it's awesome!

The following field definition solves my problem:
{{{field|Deadline|input type=regexp|base type=datetimepicker|regexp=/^\s?\d\d:\d\d\s?$/|inverse|message=You can either choose a date and a time, or just a date, but not a time alone.}}}

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links