You are here

README.txt in Calendar Systems 8

=== DESCRIPTION  ===

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

  - Supports Iranian/Persian , Arabic/Hijri/Islamic, Thai, Gregorian Calendar systems
  - Integration with Drupal's node "authored on" and "admin authored" fields
  - Supports Single language websites
  - Views Support including views built-in date filters
  - Compatible with all Drupal standard forms out of the box
  - Supports Multi language websites via locale module. Each language can have a different calendar system
  - Integration with jquery world calendars date picker
  - Supports all date module's widgets
  - Scheduler module support (If set to use standard text field)
  - API for third party usage

=== INSTALLATION ===

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

  - Apply the patch that comes with the module on "/includes/common.inc" file
    You can find the patch in module's folder at patch/core_format_date_alter.patch
	If you don't know how to apply a patch, follow the instruction here : http://drupal.org/patch/apply

  - Goto "admin/config/regionals/calendar-systems" and configure your profiles.
  - Optionally you can download and install JQuery Calendar API (http://drupal.org/project/jquery_calendar) module to add date popup support
    Will be automatically activated for popup date fields
	
	Very Important : **** CLEAR DRUPAL CACHE **** Or it won't work. How ? https://www.drupal.org/documentation/clearing-rebuilding-cache	
  
=== API ===

calendar_systems_get_calendar_instance

  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',time());

Available methods :
  $calendar->timestampToStr($format, $timestamp=null);
  $calendar->strToTimestamp($string);
  $calendar->timestampToInfoArray($timestamp=null);
  $calendar->infoArrayToTimestamp($arr);
  $calendar->date($format, $maket=null);
  $calendar->fromGregorian($g_y, $g_m, $g_d);
  $calendar->toGregorian($j_y, $j_m, $j_d);
  $calendar->smartGet($type,$value="now");
  $calendar->makeTime($hour="",$minute="",$second="",$jmonth="",$jday="",$jyear="");
  $calendar->isDateValid($month,$day,$year);
  $calendar->dateDiff($first,$second);

Converting from one calendar system to another :
  $iranian_calendar = calendar_systems_get_calendar_instance('iranian');
  $val = $iranian_calendar->strToTimestamp('1380-05-10');
  $arabic_calendar->date('Y-m-d',$val);

calendar_systems_get_calendar_system_name
  calendar_systems_get_calendar_system_name()
  Result : 'default'
  
  calendar_systems_get_calendar_system_name(NULL, 'fa')
  Result : 'iranian'


=== Extend : Plugin System and adding new calendar system ===

Calendar systems mopdule has a plugable architecure which means that each calendar system is a plugin
new calendar system can easily be added.
Plugins are located at calendar\v1\calendarSystems, they will be automatically detected and included by
Caledanr systems module once put on this location.
Copy and rename one of the calendar system in this folder and start implementing you new calendar :)

=== Support ===

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

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

  Sina Salek - http://sina.salek.ws
  Sepehr Lajevardi - D7 co-maintainer

File

README.txt
View source
  1. === DESCRIPTION ===
  2. Support for various calendar systems like Jalali, Gregorian, Hijir, Hebew, Thai, etc.
  3. - Supports Iranian/Persian , Arabic/Hijri/Islamic, Thai, Gregorian Calendar systems
  4. - Integration with Drupal's node "authored on" and "admin authored" fields
  5. - Supports Single language websites
  6. - Views Support including views built-in date filters
  7. - Compatible with all Drupal standard forms out of the box
  8. - Supports Multi language websites via locale module. Each language can have a different calendar system
  9. - Integration with jquery world calendars date picker
  10. - Supports all date module's widgets
  11. - Scheduler module support (If set to use standard text field)
  12. - API for third party usage
  13. === INSTALLATION ===
  14. - Install and enable the module as usual: http://drupal.org/node/70151
  15. - Apply the patch that comes with the module on "/includes/common.inc" file
  16. You can find the patch in module's folder at patch/core_format_date_alter.patch
  17. If you don't know how to apply a patch, follow the instruction here : http://drupal.org/patch/apply
  18. - Goto "admin/config/regionals/calendar-systems" and configure your profiles.
  19. - Optionally you can download and install JQuery Calendar API (http://drupal.org/project/jquery_calendar) module to add date popup support
  20. Will be automatically activated for popup date fields
  21. Very Important : **** CLEAR DRUPAL CACHE **** Or it won't work. How ? https://www.drupal.org/documentation/clearing-rebuilding-cache
  22. === API ===
  23. calendar_systems_get_calendar_instance
  24. You can use calendar_systems_get_calendar_instance($calendar_system = NULL, $language = NULL) to get and instance
  25. of a calendar system.
  26. For exmaple to get an instance of iranian calendar system :
  27. $calendar = calendar_systems_get_calendar_instance('iranian');
  28. $calendar->date('Y-m-d',time());
  29. Available methods :
  30. $calendar->timestampToStr($format, $timestamp=null);
  31. $calendar->strToTimestamp($string);
  32. $calendar->timestampToInfoArray($timestamp=null);
  33. $calendar->infoArrayToTimestamp($arr);
  34. $calendar->date($format, $maket=null);
  35. $calendar->fromGregorian($g_y, $g_m, $g_d);
  36. $calendar->toGregorian($j_y, $j_m, $j_d);
  37. $calendar->smartGet($type,$value="now");
  38. $calendar->makeTime($hour="",$minute="",$second="",$jmonth="",$jday="",$jyear="");
  39. $calendar->isDateValid($month,$day,$year);
  40. $calendar->dateDiff($first,$second);
  41. Converting from one calendar system to another :
  42. $iranian_calendar = calendar_systems_get_calendar_instance('iranian');
  43. $val = $iranian_calendar->strToTimestamp('1380-05-10');
  44. $arabic_calendar->date('Y-m-d',$val);
  45. calendar_systems_get_calendar_system_name
  46. calendar_systems_get_calendar_system_name()
  47. Result : 'default'
  48. calendar_systems_get_calendar_system_name(NULL, 'fa')
  49. Result : 'iranian'
  50. === Extend : Plugin System and adding new calendar system ===
  51. Calendar systems mopdule has a plugable architecure which means that each calendar system is a plugin
  52. new calendar system can easily be added.
  53. Plugins are located at calendar\v1\calendarSystems, they will be automatically detected and included by
  54. Caledanr systems module once put on this location.
  55. Copy and rename one of the calendar system in this folder and start implementing you new calendar :)
  56. === Support ===
  57. Found a bug? report it here http://drupal.org/node/add/project-issue/calendar_systems
  58. AUTHORS AND MAINTAINERS
  59. =======================
  60. Sina Salek - http://sina.salek.ws
  61. Sepehr Lajevardi - D7 co-maintainer