2017 © Pedro Peláez
 

silverstripe-module silverstripe-multidatepicker

Provides an MultipleDatePickerField for managing and saving a string of multiple dates into a text field

image

micschk/silverstripe-multidatepicker

Provides an MultipleDatePickerField for managing and saving a string of multiple dates into a text field

  • Friday, October 14, 2016
  • by micschk
  • Repository
  • 1 Watchers
  • 3 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

MultiDateField module

Provides an MultipleDatePickerField for managing and saving a string of multiple dates into a text field. Integrates jQuery MDP plugin, a plugin that enables jQuery UI calendar to manage multiple dates. See demo of the javascript interface & configuration options., (*1)

Maintainer Contact

  • Michael van Schaik

Requirements

  • SilverStripe 3.0 or newer

Features

  • Builds on silverstripe DateField (with Text field), same config & localisation supported (specific locales may need some further testing)
  • Integrates MDP 1.6.3, a plugin that enables jQuery UI calendar to manage multiple dates
  • Allows setting custom date separator (default: ", "), more Multidatepicker-specific configuration options can easily be added.
  • TODO(!): I could use some help with the silverstripe config system for this module; I'm now using ($this->getConfig('separator') ? $this->getConfig('separator') : ', ') in order to provide a callback for the date separator because sometimes custom configuration values don't seem to load.
  • TODO: Saving into many_many relation (currently only textfield supported)
  • TODO: Full unit test coverage
  • TODO: Validation (currently commented out)

Usage

Dates as Textfields

Event Model, (*2)

class Event extends DataObject {
    static $db = array(
        'Dates' => 'Text'
    );
}

Formfield Instantiation:, (*3)

$md = new MultiDateField('Dates');
    $md->setConfig('dateformat', 'dd-MM-yyyy');
    $md->setConfig('showcalendar', true);
    $md->setConfig('separator',' & ');

The Versions

14/10 2016

dev-master

9999999-dev http://github.com/micschk/silverstripe-multidatepicker

Provides an MultipleDatePickerField for managing and saving a string of multiple dates into a text field

  Sources   Download

BSD License

The Requires

 

date silverstripe field multiple