Eliminate Date Picker Drop Downs

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Eliminate Date Picker Drop Downs

Post by rpierce » 2021-05-26 17:45

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.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Eliminate Date Picker Drop Downs

Post by pbottcher » 2021-05-26 21:05

Hi,

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

Code: Select all

$j(function() {
	$j('.date_combo').hide();
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Eliminate Date Picker Drop Downs

Post by rpierce » 2021-06-04 04:22

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 @#$!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Eliminate Date Picker Drop Downs

Post by pbottcher » 2021-06-04 19:18

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.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Eliminate Date Picker Drop Downs

Post by rpierce » 2021-06-11 23:37

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'))})

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Eliminate Date Picker Drop Downs

Post by pbottcher » 2021-06-12 08:12

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'))})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Eliminate Date Picker Drop Downs

Post by rpierce » 2021-06-17 23:10

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

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Eliminate Date Picker Drop Downs

Post by pbottcher » 2021-06-18 06:42

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.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Eliminate Date Picker Drop Downs

Post by rpierce » 2022-04-29 16:03

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 2732 times
Thank you as always!
Ray

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Eliminate Date Picker Drop Downs

Post by pbottcher » 2022-04-30 07:21

Hi Ray,

which version of AppGini are you using. There have been serval changes in the different versions lately.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Eliminate Date Picker Drop Downs

Post by rpierce » 2022-05-08 01:01

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.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Eliminate Date Picker Drop Downs

Post by pbottcher » 2022-05-08 16:43

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.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply