You are here

README.txt in Calendar Systems 7.3

=== DESCRIPTION  ===

  Support for various calendar systems like Jalali, Gregorian, Hijir, Hebew, etc.

=== INSTALLATION ===

  - Install and enable the module as usual: http://drupal.org/node/70151

  - Add the following code right after "$timezones = &$drupal_static_fast['timezones'];" in "/includes/common.inc" file
    or apply the patch located in patches/ in module's directory. if you don't know how to apply patches, there is a
    good guide here: http://drupal.org/patch/apply

  // Calendar Systems module new hook (The actual hook is hook_format_date this one is only a workaround to 
  // prevent incompatibility with modules that already have a function called module_name_format_date)
  foreach (module_implements('format_date_calendar_systems') AS $module) {
    $function = $module .'_format_date';
    $r = $function($timestamp, $type, $format, $timezone, $langcode);
    
    if ($r != FALSE) {
      return $r;
    }
  }

  - Goto "admin/config/regionals/calendar-systems" and configure your profiles.
  
=== API ===
You can use calendar_systems_get_calendar_instance($calendar_system = NULL, $language = NULL) to get and instance
of a calendar system.
For exmaple to get an instance of iranian calendar system : 
$calendar = calendar_systems_get_calendar_instance('iranian');
$calendar->date('Y-m-d',mktime());

=== Support ===

Found a bug? report it here http://drupal.org/node/add/project-issue/calendar_systems

AUTHORS AND MAINTAINERS
=======================

  Sina Salek - Original developer. http://sina.salek.ws
  Sepehr Lajevardi - D7 developer.

File

README.txt
View source
  1. === DESCRIPTION ===
  2. Support for various calendar systems like Jalali, Gregorian, Hijir, Hebew, etc.
  3. === INSTALLATION ===
  4. - Install and enable the module as usual: http://drupal.org/node/70151
  5. - Add the following code right after "$timezones = &$drupal_static_fast['timezones'];" in "/includes/common.inc" file
  6. or apply the patch located in patches/ in module's directory. if you don't know how to apply patches, there is a
  7. good guide here: http://drupal.org/patch/apply
  8. // Calendar Systems module new hook (The actual hook is hook_format_date this one is only a workaround to
  9. // prevent incompatibility with modules that already have a function called module_name_format_date)
  10. foreach (module_implements('format_date_calendar_systems') AS $module) {
  11. $function = $module .'_format_date';
  12. $r = $function($timestamp, $type, $format, $timezone, $langcode);
  13. if ($r != FALSE) {
  14. return $r;
  15. }
  16. }
  17. - Goto "admin/config/regionals/calendar-systems" and configure your profiles.
  18. === API ===
  19. You can use calendar_systems_get_calendar_instance($calendar_system = NULL, $language = NULL) to get and instance
  20. of a calendar system.
  21. For exmaple to get an instance of iranian calendar system :
  22. $calendar = calendar_systems_get_calendar_instance('iranian');
  23. $calendar->date('Y-m-d',mktime());
  24. === Support ===
  25. Found a bug? report it here http://drupal.org/node/add/project-issue/calendar_systems
  26. AUTHORS AND MAINTAINERS
  27. =======================
  28. Sina Salek - Original developer. http://sina.salek.ws
  29. Sepehr Lajevardi - D7 developer.