PHP code example of bigfork / silverstripe-simpledatefield

1. Go to this page and download the library: Download bigfork/silverstripe-simpledatefield library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bigfork / silverstripe-simpledatefield example snippets


SimpleDateField::create('DateOfBirth', 'Date of birth');

// Or to offer the inputs in a different order
SimpleDateField::create('DateOfBirth', 'Date of birth', null, SimpleDateField::YMD);
SimpleDateField::create('DateOfBirth', 'Date of birth', null, SimpleDateField::MDY);

$field = SimpleDateField::create('DateOfBirth', 'Date of birth');
$field->getDayField()->setAttribute('autocomplete', 'bday-day');
$field->getMonthField()->setAttribute('autocomplete', 'bday-month');
$field->getYearField()->setAttribute('autocomplete', 'bday-year');