npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@camptocamp/php-date-formatter

v1.3.4

Published

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

Downloads

104

Readme

php-date-formatter

Bower version Stable Version Unstable Version License Packagist Downloads Monthly Downloads

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.

This library is a standalone javascript library and does not depend on other libraries or plugins like jQuery.

The latest release of the library is v1.3.4. Check the CHANGE LOG for details.

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.

Installation

Using Bower

You can use the bower package manager to install. Run:

bower install php-date-formatter

Using Composer

You can use the composer package manager to install. Either run:

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

or add:

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

to your composer.json file

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.

Usage

Step 1 Load the following assets in your header.

<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.

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.