2017 © Pedro Peláez
 

library php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

image

kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

  • Friday, July 13, 2018
  • by kartik-v
  • Repository
  • 6 Watchers
  • 30 Stars
  • 209,515 Installations
  • JavaScript
  • 2 Dependents
  • 0 Suggesters
  • 27 Forks
  • 0 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

Krajee Logo
php-date-formatter
Donate

Bower version Stable Version Unstable Version License Packagist Downloads Monthly Downloads, (*1)

A Javascript datetime library that allows you to manipulate date/times using PHP date-time formats in javascript. This library was built with an intention to read and write date/timestamps to the database easily when working with PHP server code. Use cases for this library would involve reading and saving a timestamp to database in one format, but displaying it on client or html forms in another format. Maintaining a consistent PHP Date time format for both server side and client side validation should help in building extensible applications with various PHP frameworks easily., (*2)

This library is a standalone javascript library and does not depend on other libraries or plugins like jQuery., (*3)

The latest release of the library is v1.3.6. Check the CHANGE LOG for details., (*4)

Features

  • Parse date/time strings or a Date object, and convert it into Javascript Date Object by passing any of the PHP DateTime formats.
  • Automatically guess date/time strings, even if it does not exactly match the format, and convert it into Javascript Date Object.
  • Read date/time strings or a Date object, and format it as per a PHP DateTime format.
  • With release v1.3.2 the library has been converted to use pure javacript code without dependency on jQuery or other third party JS library.

Documentation and Demo

View the library documentation and library demos at Krajee JQuery plugins., (*5)

Installation

Using Bower

You can use the bower package manager to install. Run:, (*6)

bower install php-date-formatter

Using Composer

You can use the composer package manager to install. Either run:, (*7)

$ php composer.phar require kartik-v/php-date-formatter "@dev"

or add:, (*8)

"kartik-v/php-date-formatter": "@dev"

to your composer.json file, (*9)

Manual Install

You can also manually install the plugin easily to your project. Just download the source ZIP or TAR ball and extract the plugin assets (css and js folders) into your project., (*10)

Usage

Step 1 Load the following assets in your header., (*11)

<script src="path/to/js/php-date-formatter.min.js" type="text/javascript"></script>

Step 2 You can now access the library using the DateFormatter object. For example, you can convert any date string to javascript date object for a specific PHP date format., (*12)

var fmt = new DateFormatter();
var date1 = fmt.parseDate('23-Sep-2013 09:24:12', 'd-M-Y H:i:s');
var date2 = fmt.formatDate(date1, 'd-F-Y h:i:s A');

License

php-date-formatter is released under the BSD 3-Clause License. See the bundled LICENSE.md for details., (*13)

The Versions

13/07 2018

dev-master

9999999-dev https://github.com/kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

  Sources   Download

BSD-3-Clause

php javascript date formatter time datetime php-date-formatter.js

13/07 2018

v1.3.5

1.3.5.0 https://github.com/kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

  Sources   Download

BSD-3-Clause

php javascript date formatter time datetime php-date-formatter.js

08/01 2017

v1.3.4

1.3.4.0 https://github.com/kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

  Sources   Download

BSD-3-Clause

php javascript date formatter time datetime php-date-formatter.js

21/12 2015

v1.3.3

1.3.3.0 https://github.com/kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

  Sources   Download

BSD-3-Clause

php javascript date formatter time datetime php-date-formatter.js

20/12 2015

v1.3.2

1.3.2.0 https://github.com/kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

  Sources   Download

BSD-3-Clause

php javascript date formatter time datetime php-date-formatter.js

18/12 2015

dev-closure

dev-closure https://github.com/kartik-v/php-date-formatter

A JQuery datetime formatting and manipulation library using PHP date-time formats in javascript.

  Sources   Download

BSD-3-Clause

php jquery javascript date formatter time datetime php-date-formatter.js

18/06 2015

v1.3.1

1.3.1.0 https://github.com/kartik-v/php-date-formatter

A JQuery datetime formatting and manipulation library using PHP date-time formats in javascript.

  Sources   Download

BSD-3-Clause

php jquery javascript date formatter time datetime php-date-formatter.js

08/11 2014

v1.3.0

1.3.0.0 https://github.com/kartik-v/php-date-formatter

A JQuery datetime formatting and manipulation library using PHP date-time formats in javascript.

  Sources   Download

BSD 3-Clause

php jquery javascript date formatter time datetime php-date-formatter.js

05/10 2014

v1.2.0

1.2.0.0 https://github.com/kartik-v/php-date-formatter

A JQuery datetime formatting and manipulation library using PHP date-time formats in javascript.

  Sources   Download

BSD 3-Clause

php jquery javascript date formatter time datetime php-date-formatter.js