2017 © Pedro Peláez
 

silverstripe-module silverstripe-timefield

HTML5 time field for Silverstripe

image

silverstripers/silverstripe-timefield

HTML5 time field for Silverstripe

  • Wednesday, March 23, 2016
  • by silverstripers
  • Repository
  • 7 Watchers
  • 0 Stars
  • 75 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

SilverStripe HTML5 date/time fields and TimeDropdownField

SilverStripe TimeField is a module which consists of 3 form fields., (*1)

  1. HTML5DateField
  2. HTML5TimeField
  3. TimeDropdownField

HTML5 date and time fields overwrite the SilverStripe's default DateField and TimeField with field which HTML5 input types. TimeDropdownField generates a dropdown field with time and you can set the interval, (*2)

Installing

User composer to install, (*3)

composer require silverstripers/silverstripe-timefield dev-master, (*4)

Features

First, the new input type reduce our reliance on client-side and server-side-scripting for validating inputs and this field is easy to use rather than using text field to enter time. No need of any coding to get the HTML5DateField and HTML5TimeField overwritten in site wide. Just need to install the module., (*5)

Browser Support

Based on the HTML5 date and time input types, these are supported in:, (*6)

  1. Chrome 33+
  2. Firefox 22+
  3. Opera 22+
  4. Safari 7+

Internet explorer doesn't support this., (*7)

Codes

Change the interval of minutes in HTML5TimeField

add this in your config.yml. value should be in seconds., (*8)

HTML5TimeField:
  interval: '900'

Add TimeDropdownField

add this in the getCMSFields() of the Page/DataObject you want to display the field. That will add 600 seconds inteval (10 mins)., (*9)

$fields->addFieldToTab('Root.TabName', TimeDropdownField('FieldName')->setInterval(600))

The Versions

23/03 2016

dev-master

9999999-dev

HTML5 time field for Silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

by Nivanka Fonseka
by Priyashantha Hp
by Manoj Buddhika

silverstripe news