Kirby-Datepicker

#Kirby Datepicker

My very first plugin that provides you with a datepicker field in the kirby panel. It is basically a wrapper for the wonderful flatpickr.

You can find the plugin and its full documentation on my Github page

I implemented a bunch of customization utilities via config file. In a later release I might change that to provide some options via blueprint.

You might want to customize the datepicker’s theme or maybe customize it yourself :slight_smile:

You can fully customize the date format and also chose a different format in which the data should be stored in your file.
The full list of date formats can be seen on github#date-format-characters

You could also add a time field to the calendar or just use it as a Timepicker :slight_smile:

Because there are such a high amount of customization possibilities I did not find the time jet to test them all in and out. If you find bugs feel free to open an issue on github. However because this is just a wrapper and I am more or less passing options to it, it should work fine in the most cases.

Fell free to enjoy & share

Cheers

1 Like

Do you know about this one?

https://getkirby.com/docs/cheatsheet/panel-fields/date

A built in date field.

Yea sure :slight_smile: building something totally new was not my intention.

I wanted to learn how to build a custom kirby field and whats a better way to learn then finding a simple use case and start doing it?

So maybe someone find mine more appealing or it has some functionality that the built in kirby date field does not provide. E.g. my plugin provides a way of saving data in an other way then displaying it to the user, which comes handy for me because I want to generate an ID in the format yyyymmdd to filter events according to their date but I don’t want to display it that way.

If you don’t need it just don’t use it

3 Likes

Great! It’s always nice with different approaches. :slight_smile:

Could someone help me out with the following issue:

It seems that there is some problem when I want to use my datepicker in a structured field. Maybe it is a problem with the routing?
This is the routes function I used from the boiler plate of @jenstornell:

  // Routes - Makes Ajax possible - https://forum.getkirby.com/t/routing-in-custom-form-field/3101/7
  public function routes() {
    return array(
      array(
        'pattern' => 'ajax/(:any)/(:any)',
        'method'  => 'get',
        'action' => function($var1, $var2) {
          // pass options json-data back to javascript via ajax response
          return response::json( array( 
              'dp_options', self::$dp_options
          ));
        }
      )
    );
  }

But the data object that gets passed to javascript via ajax does not contain my options array but some data coming from wherever :blush:

This is what the dev console gets me:

This is like I said just not working with structured fields. What am I missing to make it work for those too?

Cheers