Arabic
[ class tree: Arabic ] [ index: Arabic ] [ all elements ]

Class: ArDate

Source Location: /sub/ArDate.class.php

Class Overview


This PHP class is an Arabic customization for PHP date function


Author(s):

Copyright:

  • 2006-2010 Khaled Al-Shamaa

Variables

Methods



Class Details

[line 169]
This PHP class is an Arabic customization for PHP date function



Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2006-2010 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL


[ Top ]


Class Variables

static $islamicEpoch =  1948439.5

[line 174]



Tags:

access:  protected

Type:   mixed


[ Top ]

$dateOutput =  'utf-8'

[line 180]

"date" method output charset



Tags:

access:  public

Type:   String


[ Top ]

$mode =  1

[line 171]



Tags:

access:  protected

Type:   mixed


[ Top ]

$xml =  null

[line 172]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 185]

ArDate __construct( )

Loads initialize values



Tags:

access:  public


[ Top ]

method arabicMonths [line 394]

array arabicMonths( integer $mode)

Add Arabic month names to the replacement array



Tags:

return:  Arabic month names in selected style
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $mode   Naming mode of months in Arabic where: 2) Arabic month names used in Middle East countries 3) Arabic Transliteration of Gregorian month names 4) Both of 2 and 3 formats together 5) Libya style 6) Algeria and Tunis style 7) Morocco style

[ Top ]

method date [line 245]

string date( string $format, integer $timestamp, [integer $correction = 0])

Format a local time/date in Arabic string



Tags:

return:  Format Arabic date string according to given format string using the given integer timestamp or the current local time if no timestamp is given.
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $format   Format string (same as PHP date function)
integer   $timestamp   Unix timestamp
integer   $correction   To apply correction factor (+/- 1-2) to standard hijri calendar

[ Top ]

method dateCorrection [line 502]

integer dateCorrection( integer $time)

Calculate Hijri calendar correction using Um-Al-Qura calendar information



Tags:

return:  Correction factor to fix Hijri calendar calculation using Um-Al-Qura calendar information
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

integer   $time   Unix timestamp

[ Top ]

method en2ar [line 335]

string en2ar( string $str)

Translate English date/time terms into Arabic langauge



Tags:

return:  Date/time string using Arabic terms
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $str   Date/time string using English terms

[ Top ]

method getMode [line 227]

Integer getMode( )

Getting $mode value that refer to output mode format

1) Hijri format (Islamic calendar) 2) Arabic month names used in Middle East countries 3) Arabic Transliteration of Gregorian month names 4) Both of 2 and 3 formats together 5) Libyan way




Tags:

return:  Value of $mode properity
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


[ Top ]

method gregToJd [line 476]

integer gregToJd( integer $m, integer $d, integer $y)

Converts a Gregorian date to Julian Day Count



Tags:

return:  The julian day for the given gregorian date as an integer
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $m   The month as a number from 1 (for January) to 12 (for December)
integer   $d   The day as a number from 1 to 31
integer   $y   The year as a number between -4714 and 9999

[ Top ]

method hjConvert [line 415]

array hjConvert( integer $Y, integer $M, integer $D)

Convert given Gregorian date into Hijri date



Tags:

return:  Hijri date [int Year, int Month, int Day](Islamic calendar)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $Y   Year Gregorian year
integer   $M   Month Gregorian month
integer   $D   Day Gregorian day

[ Top ]

method islamicToJd [line 459]

integer islamicToJd( integer $year, integer $month, integer $day)

Convert given Hijri date into Julian day



Tags:

return:  Julian day
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $year   Year Hijri year
integer   $month   Month Hijri month
integer   $day   Day Hijri day

[ Top ]

method jdToIslamic [line 437]

array jdToIslamic( integer $jd)

Convert given Julian day into Hijri date



Tags:

return:  Hijri date [int Year, int Month, int Day](Islamic calendar)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

integer   $jd   Julian day

[ Top ]

method setMode [line 205]

object setMode( [integer $mode = 1])

Setting value for $mode scalar



Tags:

return:  to build a fluent interface
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

integer   $mode   Output mode of date function where: 1) Hijri format (Islamic calendar) 2) Arabic month names used in Middle East countries 3) Arabic Transliteration of Gregorian month names 4) Both of 2 and 3 formats together 5) Libya style 6) Algeria and Tunis style 7) Morocco style

[ Top ]


Documentation generated on Sat, 14 Aug 2010 13:23:54 -0700 by phpDocumentor 1.4.0