Hello, I just noticed that when using the DateChooser from another context, ie the filterEditor of a grid, it doesn't have this limitation:
even if you choose 1994, the "first_page" icon remains enabled, and if you select a year and re-open the dateChooser yearMenu, you'll see a different range of years based on the last selected year:
I can't help myself but I just think that this is a better UE for the DateChooser in all cases.
Announcement
Collapse
No announcement yet.
X
-
Originally posted by Isomorphic View Post2) If startDate/endDate do not limit the navigation of the DateChooser, what are you hoping for them to do?
If you are hoping that the dropdown has a limited range of years but it is still secretly possible to enter other years via the DateChooser, that's definitely not something we'd want to do.
Also if I enter a random date in the year 1900, and open the DateChooser, I see this:
where the years are enabled, because there are only the "valid" years, and the dateChooserNavMonth/Year buttons are disabled. Then the dateChooserMonthMenu is disabled, but the days are enabled, even the "otherDays", so you can effectively use those to change month and eventually also year.
I may be wrong (as i'm a user that normally types dates*), but I have the feeling that it is a logic that may not be appreciated by less technical users.
(*) especially because useTextField in combination with the mask is really a very good UX in my opinion
Leave a comment:
-
1) The startYear / startYearRange attributes on DateChooser are for direct use of the DateChooser outside of DateItem. When the DateChooser is generated by a DateItem, the DateItem sets these automatically based on dateItem.startDate/endDate.
2) If startDate/endDate do not limit the navigation of the DateChooser, what are you hoping for them to do?
If you are hoping that the dropdown has a limited range of years but it is still secretly possible to enter other years via the DateChooser, that's definitely not something we'd want to do.
Leave a comment:
-
Hi, thanks for the clarification, so it's a new feature, cool.
I was actually interested in customizing the dateChooserYearMenu, and now I have two questions:
1. is it correct to set DateItem.start/endDate and generateValidator:false to customize the range of years visible in the dateChooserYearMenu without create a validator? I also saw the startYear/startYearRange attributes but I didn't understand if I can change them (not globally).
2. Why do the dateChooserNavButtons not allow navigation beyond the displayed range, when there is no validator set?Last edited by claudiobosticco; 11 Jun 2024, 05:46.
Leave a comment:
-
hi Claudio,
The dateRange-validator is generated automatically here, if you don't add one - if you don't want the startDate/endDate range to be enforced in this way, you can set item.generateValidator to false.
Leave a comment:
-
Note that the error is raised also if you add startDate/endDate to a single dateItem.
Leave a comment:
-
Originally posted by claudiobosticco View Postthank you very much
this works:
Code:isc.DateItem.addProperties({ startDate:isc.Date.createLogicalDate(new Date().getFullYear() - 5, 1, 1), endDate:isc.Date.createLogicalDate(new Date().getFullYear() + 14, 12, 31) }); isc.RelativeDateItem.addProperties({ startDate:isc.Date.createLogicalDate(new Date().getFullYear() - 5, 1, 1), endDate:isc.Date.createLogicalDate(new Date().getFullYear() + 14, 12, 31) });
Code:isc.DateItem.addProperties({ startDate: isc.Date.createLogicalDate(new Date().getFullYear() - 5, 1, 1, 0, 0, 0), endDate: isc.Date.createLogicalDate(new Date().getFullYear() + 14, 12, 31, 0, 0, 0) }) isc.DynamicForm.create({ ID: "dateForm", numCols: 4, width: 650, fields: [ {name:"directInputDate", title:"Direct Input Date", type:"date", useTextField:true, wrapTitle:false, defaultValue:new Date(2000, 0, 1)} ] }); isc.IButton.create({ title: "Validate", top:50, click: "dateForm.validate()" })
Leave a comment:
-
thank you very much
this works:
Code:isc.DateItem.addProperties({ startDate:isc.Date.createLogicalDate(new Date().getFullYear() - 5, 1, 1), endDate:isc.Date.createLogicalDate(new Date().getFullYear() + 14, 12, 31) }); isc.RelativeDateItem.addProperties({ startDate:isc.Date.createLogicalDate(new Date().getFullYear() - 5, 1, 1), endDate:isc.Date.createLogicalDate(new Date().getFullYear() + 14, 12, 31) });
Leave a comment:
-
If you're trying to change the DateChooser automatically launched by a DateItem, you'll need to change the defaults for DateItem startDate/endDate.
Leave a comment:
-
can't change startYear and endYear DateChooser defaults
SmartClient Version: v8.3d_2012-11-13/PowerEdition Development Only (built 2012-11-13)
Chrome 23.0.1271.64 on Mac OSX
Safari 6.0.2 (8536.26.17)
adding this code in the sample #dateRangeFilter
Code:isc.DateChooser.addProperties({ startYear: 2007, endYear: 2027, firstDayOfWeek:1 });
Tags: None
Leave a comment: