Daterange Picker (from/until)

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Daterange Picker (from/until)

Post by jsetzer » 2019-12-05 07:19

PRO-Tipp for you AppGineers out there:

If you need inputs for a period (from date - to date), just create two datetime-fields in AppGini, then call the following code in hooks/TABLENAME-dv.js:

Code

Code: Select all

new AppGiniFields(["valid_from", "valid_to"]).toDatepicker("Valid from/to");
Output
chrome_lX4BkSGbxE.png
chrome_lX4BkSGbxE.png (1.93 KiB) Viewed 10976 times

Check this out. Both inputs will be linked which means for example after you have selected from-date, the to-date-picker is limited to future dates and vice versa.

Please note
  • Datatype has to be Datetime
  • Pass an array of exactly 2 (!) fieldnames to the constructor of AppGiniFields
  • Pass a string to the toDatepicker() function. This will be the new label.
  • Both pickers will be aligned inline with 50% width
  • Your project's date-format should be applied automatically
Documentation

https://appgini.bizzworxx.de/products/j ... ge-picker/

Hope you like it!

Best,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

chrisagon
Posts: 18
Joined: 2016-10-13 19:38
Location: Paris, France
Contact:

Re: Daterange Picker (from/until)

Post by chrisagon » 2020-03-19 11:36

Hello,
I try to insert this AppGiniFields in a new AppGiniLayout but it doesn't seems to work :

Code: Select all

var date_periode = new AppGiniFields(["date_debut", "date_fin"]).toDatepicker("Période :");
var row_1 = new AppGiniLayout([12])
    .add(1, ["#Mission", "site_mission", "periode", date_periode , "-"])
    .sizeLabels(2)
    ;
I have the error :

Code: Select all

AppGiniHelper.min.js:6 Uncaught TypeError: _0x26630e[bx_0x3f2d(...)] is not a function
    at AppGiniHelper.min.js:6
    at Array.forEach (<anonymous>)
    at _0x34db9f._0x1cbc4c.add (AppGiniHelper.min.js:6)
    at missions-dv.js:15
Chrisagon.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Daterange Picker (from/until)

Post by jsetzer » 2020-03-26 04:42

I'm not sure, can you please try to first move the two fields into the layout and afterwards call the toDatepicker function.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

chrisagon
Posts: 18
Joined: 2016-10-13 19:38
Location: Paris, France
Contact:

Re: Daterange Picker (from/until)

Post by chrisagon » 2020-03-26 11:17

It seems so easy when it works :-)
Thank you.
Chrisagon.

Post Reply