Needs work
Project:
Date
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2011 at 21:39 UTC
Updated:
7 Feb 2019 at 01:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jonlhouse commentedI agree. I've used the mod for a lot of cool things but I can't seems to figure out how to set the #maxlength property on a 'date_combo' type. Any help would be appreciated
Comment #2
karens commented#size and #maxlength are attributes for an individual form element. The combo type is a collection of dates which are themselves collections of individual form elements, and the length and size of each of the sub-elements may not be the same. Setting these attributes on a combo date would be meaningless.
Comment #3
vitalie commentedHi, I would like to re-open discussion on this. I am not sure it is meaningless.
I am adding a date field with granularity set only to Year. I need an end date too. The text elements have the default size of 60 - it is two much for a 4-digit input. I would like to be able to set the size of the text fields, even if it was one size for both of them.
Comment #4
Countzero commentedSecond that : 60 chars for year only is absurd.
Why not rely on the standard form element properties ?
Comment #5
mastoll commentedThis is exactly my concern. Has anyone found a way to adjust the element size and maxlength?
Comment #6
Chris CharltonNo. This issue remains valid.
Comment #7
nicxvan commentedI would like to revisit this as well. I have a date field that takes in only the month day and year and the #size attribute is respected. If I have a date field that takes only the hour and time the #size is not respected.
I can see a couple solutions, one pin the #size to what is set, or allow a nested array that defines the size of each element.
Needing to use hook_date_popup_process_alter to get the #size to be what you need seems counter intuitive.
Comment #8
nicxvan commentedComment #9
jromine commentedPatch attached to allow setting size & maxlength for date_text (textfield) input widget.
Comment #10
Chris Charlton+1 for #9 (passed tests).
Thanks @jromine!
Comment #11
damienmckennaThanks for putting that together.
If you don't mind, I'd like to request a few small changes.
Thanks.