PHP code example of gustavowiller / intl-date-time
1. Go to this page and download the library: Download gustavowiller/intl-date-time 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/ */
gustavowiller / intl-date-time example snippets
namespace App\Nova;
use Illuminate\Http\Request;
use Techouse\IntlDateTime\IntlDateTime as DateTime;
class User extends Resource
{
/**
* This is how you use and configure this module
*/
public function fields(Request $request)
{
return [
DateTime::make(__('Updated at'), 'updated_at')
/**
* The module automatically uses your app's locale
* from config('app.locale'), however you can manually
* override this by setting it like this.
*
* IMPORTANT: Check the list of supported locales below in this readme!
*
* NOTE: If the automatic locale is not supported by MomentJS
* the module defaults to 'en-gb' (British English).
*/
->locale('sl'),
DateTime::make(__('Created at'), 'created_at')
/**
* You can optionally set a custom DATE format.
*
* It has to be compatible with MomentJS!!!
* https://momentjs.com/docs/#/displaying/format/
*/
->dateFormat('DD.MM.YYYY'),
DateTime::make(__('Deleted at'), 'deleted_at')
/**
* You can optionally set a custom TIME format
*
* It has to be compatible with MomentJS!!!
* https://momentjs.com/docs/#/displaying/format/
*/
->timeFormat('HH:mm:ss'),
];
}
/**
* The rest of the Resource ... bla bla bla :)
*/
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.