Date picker style and dates allowed

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
mihaadzic
Posts: 5
Joined: 2016-07-27 07:41

Date picker style and dates allowed

Post by mihaadzic » 2016-08-19 06:15

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

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 213
Joined: 2013-03-21 04:37

Re: Date picker style and dates allowed

Post by peebee » 2016-08-19 08:23

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

mihaadzic
Posts: 5
Joined: 2016-07-27 07:41

Re: Date picker style and dates allowed

Post by mihaadzic » 2016-09-01 06:44

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.

mihaadzic
Posts: 5
Joined: 2016-07-27 07:41

Re: Date picker style and dates allowed

Post by mihaadzic » 2016-10-10 11:03

I can't find any docs on how to do this.

Anyone? peebee?

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: Date picker style and dates allowed

Post by DevGiu » 2016-10-11 15:27

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.
/Giuseppe
Professional Outsourcing Services

bambinou
Veteran Member
Posts: 162
Joined: 2013-02-01 15:09

Re: Date picker style and dates allowed

Post by bambinou » 2017-08-31 13:57

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.

Post Reply