Sugree

Main menu

  • About
    • Self
  • Project
    • jibjib
  • English
  • Thai

Patch

Better patch for Buddhist era in Drupal

Submitted by sugree on Sat, 12/22/2007 - 13:10.
  • Drupal
  • English
  • Patch

After the first patching attempt to display Buddhist era in Drupal correctly, I found an annoying issue as a result at Drupal Thailand while trying to edit my own comment. The node's date is formatted by format_date() using custom format with Y. Unfortunately, the date string is converted back to seconds using strtotime() which doesn't recognize Buddhist era, says 2550. I had to change 2550 to 2007 to save that comment.

  • Add new comment
  • Read more

Patch for Buddhist era in Drupal

Submitted by sugree on Fri, 12/21/2007 - 12:16.
  • Drupal
  • English
  • Patch

I got a request to fix problem regarding lack of Buddhist era in Drupal for so long. This should be classified as a bug of PHP and Drupal. PHP provides only strftime() which recognizes locale setting, setlocale(). Unfortunately, Drupal uses only gmdate(). That's the problem. So I have to patch common.inc to handle Y and y alternatively.

  • Add new comment
  • Read more

Popular Tags

Assumption BarCamp BarCampBangkok birdnest BitTorrent BugAThon Creature Drupal DrupalCamp DrupalCampBangkok Education GnuCash Google Gutsy Hardware Hardy Health Java jibjib Joke OpenOffice.org Python Review SoC Social Network Trip TwittBKK TwittDay Twitter Ubuntu
more tags

Powered By

debian
apache
drupal
drupal.in.th
feedburner

© 2007-2008 Sugree Phatanapherom. Creative Commons [Feed Content / Comment]
RoopleTheme