Ticket #344 (closed defect: invalid)
unable to define end date in date range
| Reported by: | gdb | Owned by: | mpo |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | modules/kauri-forms | Version: | trunk |
| Keywords: | date-range | Cc: | kauri-discuss@… |
Description
When I update the forms-sample - date-control - holiday (date-range) sample to the fconf below I can't define a end date different from the start date.
It is also not possible to define first the end date and then the start date.
"holiday": {
"base": "date-range",
"label": "When is your holiday?",
"user-format" : [ "wire-date", {"pattern" : "dd/mm/yy"} ],
"wire-format" : [ "wire-date", {"pattern" : "dd/mm/yy"} ],
"control" : {
"base" : 'date-control',
"pickerOptions" : {
"buttonImageOnly" : false,
"showOn" : 'focus'
}
}
}
Attachments
Change History
Changed 3 years ago by gdb
- Attachment date-control.html.xml added
comment:1 Changed 3 years ago by freya
- Status changed from new to closed
- Resolution set to invalid
Hi,
because it is a date range (contains 2 members: start and end), you need to extend this start and end, and not the range with the datepicker properties.
This is the code you need:
"holiday": {
"base": "date-range",
"label": "When is your holiday?",
'members' : {
"start" : {
"base" : "date",
"control" : {
"base" : "date-control",
"pickerOptions" : {
"buttonImageOnly" : false,
"showOn" : 'focus'
}
}
},
"end" : {
"base" : "date",
"control" : {
"base" : "date-control",
"pickerOptions" : {
"buttonImageOnly" : false,
"showOn" : 'focus'
}
}
}
},
"user-format" : [ "wire-date", {"pattern" : "dd/mm/yy"} ],
"wire-format" : [ "wire-date", {"pattern" : "dd/mm/yy"} ]
}
Note: See
TracTickets for help on using
tickets.
the date control sample updated with my fconf