Page 1 of 1

Date picker style and dates allowed

Posted: 2016-08-19 06:15
by mihaadzic
Hi!

I'm trying to change how the date picker looks like.

The select date icon is fine but then there are 3 dropdown fields whitch I would like to remove and just have the selected date displayed.
Also it should have some text like "please select the date" if no date has been selected yet.

One more thing is that the date picker should not allow users to select dates that go more the 5 days into the past and 2 days into the future. Only the administrators should have the right to pick any date.

Can this be done and how?

Thank you!

Using AppGini 5.51

Re: Date picker style and dates allowed

Posted: 2016-08-19 08:23
by peebee
The datepicker used in AppGini is a third party plugin: http://freqdec.github.io/datePicker

I haven't read it all but on a quick glance it does look to be quite configurable. Hopefully you can achieve what you're after.

You'll find all of the datepicker code in /resources/datepicker

Re: Date picker style and dates allowed

Posted: 2016-09-01 06:44
by mihaadzic
Hi!

Thank you for the link. From there I found this: http://freqdec.github.io/datePicker/demo/
In this demo I can find, that the AppGini si using stylike like Demo #4.

I would like to change it to look like in Demo #1 - just barebones datepicker (no dropdowns).
Is that the datepicker or AppGini thingy?

Thank you.

Re: Date picker style and dates allowed

Posted: 2016-10-10 11:03
by mihaadzic
I can't find any docs on how to do this.

Anyone? peebee?

Re: Date picker style and dates allowed

Posted: 2016-10-11 15:27
by DevGiu
Is hardcoded in DateCombo.class.php

I think one of the best ways to go until AppGini do it natively, is to hide date field, and use grimblefritz lib to create a new field (search mkfield in forums) then apply datepicker manually and "onchange" put the value on "original hided" date field.

I hope I explained.

Re: Date picker style and dates allowed

Posted: 2017-08-31 13:57
by bambinou
I looked into this myself and here is how I have managed to get a date picker working.

Look for the header.php and paste this into it:
In the CSS part:
<link rel="stylesheet" href="<?php echo PREPEND_PATH; ?>resources/jquery/css/jquery-ui.css" media="screen">


In the JS part:
<script src="<?php echo PREPEND_PATH; ?>resources/jquery/js/jquery-ui.min.js"></script>


Now download both files from here:
http://jqueryui.com/download/

Toggle all the tick boxes and simply choose widget>>datepicker


Add the files in their respective locations(as shown in the path above(resources folder).


Now in your custom php file, call the calender like this:
<script>
$j( function() {
$j( "#datepicker" ).datepicker();
} );
</script>

AND NOT:
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>


The above will not work because I have noticed that this is added in the header:
<script>var $j = jQuery.noConflict();</script>


This is how I got a calendar up and running correctly.

Hope this helps.

Re: Date picker style and dates allowed

Posted: 2019-11-27 08:11
by jsetzer
Maybe this information will help:
viewtopic.php?f=13&t=3331#p11581