Page 1 of 1

Eliminate Date Picker Drop Downs

Posted: 2021-05-26 17:45
by rpierce
Is there a way to completely eliminate the date picker drop down menus? Using these it is possible to inadvertently create dates that don't possibly exist such as February 30, or November 31. Using the graphic calendar is the best method and I would like to us that exclusively on my apps.

Re: Eliminate Date Picker Drop Downs

Posted: 2021-05-26 21:05
by pbottcher
Hi,

you can add to the hooks/tablename-dv.js file

Code: Select all

$j(function() {
	$j('.date_combo').hide();
})

Re: Eliminate Date Picker Drop Downs

Posted: 2021-06-04 04:22
by rpierce
That worked at removing the drop downs which is absolutely great. However, once a date is selected using the calendar, I still need to have the selected date shown. Sorry to be such a pain in the @#$!

Re: Eliminate Date Picker Drop Downs

Posted: 2021-06-04 19:18
by pbottcher
Hi,

try to add

Code: Select all

$j('#FIELD').on('change',function(e) {$j('#fd-but-FIELD').text($j('#FIELD-date-picker-hover').attr('title'))})
replace FIELD with the fieldname that you use for you field.

Re: Eliminate Date Picker Drop Downs

Posted: 2021-06-11 23:37
by rpierce
I don't know if I've done it correctly. As I have it here, the date is displayed in DV until I save or change anything. The date is stored in the database but still not visible in DV once anything on the screen changes.

Code: Select all

$j(function() {
	$j('.date_combo').hide();
})
$j('#date').on('change',function(e) {$j('#fd-but-date').text($j('#date-date-picker-hover').attr('title'))})

Re: Eliminate Date Picker Drop Downs

Posted: 2021-06-12 08:12
by pbottcher
Actually nothing, I thought you could add the pieces together.

try

Code: Select all

$j(function() {
	$j('.date_combo').hide();
	if ($j('#date').val != "") $j('#fd-but-date').text($j('#date-date-picker-hover').attr('title'));
})
$j('#date').on('change',function(e) {$j('#fd-but-date').text($j('#date-date-picker-hover').attr('title'))})

Re: Eliminate Date Picker Drop Downs

Posted: 2021-06-17 23:10
by rpierce
Hi,

I tried that new code but get the same thing. The date picker (calendar style) is displayed and the date is shown until I save. The date is properly stored but not visible in DV.

Thank you for all the effort!!

Ray

Re: Eliminate Date Picker Drop Downs

Posted: 2021-06-18 06:42
by pbottcher
Hi,
sorry, yes that was not quite correct.

Try

Code: Select all

$j(function() {
	$j('.date_combo').hide();
	if ($j('#date').val() != "") $j('#fd-but-date').text($j('#date-dd').val()+'-'+$j('#date-mm').val()+'-'+$j('#date').val());
})
$j('#date').on('change',function(e) {$j('#fd-but-date').text($j('#date-date-picker-hover').attr('title'))})
Format the date with the

$j('#date-dd').val()+'-'+$j('#date-mm').val()+'-'+$j('#date').val()

as you need it.

Re: Eliminate Date Picker Drop Downs

Posted: 2022-04-29 16:03
by rpierce
Hi Pascal,

It's been a while since I looked at this topic.
The code is working and I have an additional help question around it. Is there a way to align the date picker to the left of the screen. Currently it is aligned to the right with a large blank space to the left of it.
datepicker.JPG
datepicker.JPG (53.75 KiB) Viewed 2935 times
Thank you as always!
Ray

Re: Eliminate Date Picker Drop Downs

Posted: 2022-04-30 07:21
by pbottcher
Hi Ray,

which version of AppGini are you using. There have been serval changes in the different versions lately.

Re: Eliminate Date Picker Drop Downs

Posted: 2022-05-08 01:01
by rpierce
Hello Pascal,

I'm currently using version 5.97. That's only because I found a bug in the new version that affects iframe embed codes. Every time you save a record that has an iframe in it the word "Sandbox" is inserted. A single insertion of that causes no issues. But it happens every time you save the record. So save 10 times Sandbox 10 times. That breaks the embed code.

Re: Eliminate Date Picker Drop Downs

Posted: 2022-05-08 16:43
by pbottcher
Hi Ray,

for 5.97 you can try:

Code: Select all

$j(function() {
	$j('.date_combo').hide();
	$j('.form-group.'+AppGini.currentTableName()+'-date .btn-group').removeClass('pull-right');
	if ($j('#date').val() != "") $j('#fd-but-date').text($j('#date-dd').val()+'-'+$j('#date-mm').val()+'-'+$j('#date').val());
})
$j('#date').on('change',function(e) {$j('#fd-but-date').text($j('#date-date-picker-hover').attr('title'))})
If you upgrade to >= 22.11 this will not work any more. You need to adopt it.