Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sky93/ezdate
The easiest way to convert dates to persian date.
https://github.com/sky93/ezdate
convert-dates date jquery jquery-plugin plugin
Last synced: 14 days ago
JSON representation
The easiest way to convert dates to persian date.
- Host: GitHub
- URL: https://github.com/sky93/ezdate
- Owner: sky93
- License: mit
- Created: 2016-11-19T06:22:25.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-14T09:14:20.000Z (almost 8 years ago)
- Last Synced: 2024-10-03T05:07:01.850Z (about 1 month ago)
- Topics: convert-dates, date, jquery, jquery-plugin, plugin
- Language: HTML
- Homepage:
- Size: 48.8 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# ezdate: a jQuery plugin
[![NPM](https://img.shields.io/npm/v/ezdate.svg)](https://www.npmjs.com/package/ezdate)
[![Bower](https://img.shields.io/bower/v/ezdate.svg)](http://bower.io/search/?q=ezdate)
[![npm](https://img.shields.io/npm/l/ezdate.svg)](https://github.com/sky93/ezdate/blob/master/License.md)
[![Github All Releases](https://img.shields.io/npm/dt/ezdate.svg)](https://github.com/sky93/ezdate)The easiest and the best way to convert dates to persian date.
---
ezdate is a **1 KB** (gzipped, minfied) jquery function that converts dates in your website automatically to persian date.---
## UsageFirst, load jQuery and the plugin:
```html
```
Now, let's attach it to your timestamps on DOM ready - put this in the head
section:```html
jQuery(document).ready(function() {
$("time.ezdate").ezdate();
});```
This will turn all `
```html
```into something like this:
```html
```##Options
####`persianNumber` (_default: `false`_)```javascript
$("time.ezdate").ezdate({
persianNumber: true
});
````
Turns:
```html
```
into
```html
```---
####`attrName` (_default: `'data-datetime'`_)
Date source attribute. It's recommended to use `data-datetime` for ezdate as it's HTML5 friendly too.---
####`dateFormat` (_default: `D/M/YYYY`_)
You can use your custom date format to show.*Some examples:*
| Value | Meaning |
|---------------|--------------|
| `D/M/YYYY` | 26/7/1372 |
| `D/MM/YYYY` | 26/07/1372 |
| `DD/MMM/YYYY` | 26/مهر/1372 |---
ezdate also calls `complete` function when finished its job as callback.Enjoy using ezdate!