/persian_date

A drupal module provide a service for convert gregorian date to jalai.

Primary LanguagePHP

PersianDate

Installation

Download this module and add in module directory and enable it.

How to work?

This module create a service that called by
\Drupal::service('persian_date.get_jalali')->getJalali(FORMAT, TIMESTAMP)

Example:
\Drupal::service('persian_date.get_jalali')->getJalali('Y-n-j', 1501572172)

Parameters:
format Example: 'Y-n-j'
timestamp Default: time()
tr_num Default: 'en'
time_zone Default: 'Asia/Tehran'

Result:
name Example: Lorem ipsum
image Example: Source of image