I have a Persian language website and I need to a archive block in my site. but date of default archive view is Gregorian. I install Datex module and it convert all date of nodes to Jalali(Shamsi) Date but can't convert Gregorian date to Jalali Date in archive view. I want to archive content in year+month format. any one has another idea for convert date in archive view?


you can use of persoanTools module persian Tools change calender to jalali and you can use of it in archive and views pages


to display jalali date in drupal, you can do one of the following :

  1. install persian tools and Calendar Systems and in node.tpl file write the following:
<time datetime="<?php print date('Y-m-d H:i:s', $node->created) ?>"><?php print $date ?></time>
  1. get timestamp from php, convert it to javascript timestamp and display it using toLocalDateString():
<time datetime="<?php print date('Y-m-d H:i:s', $node->created); ?>">
    <span class="publishedon">
        <script>let pdate = new Date(<?php print $node->created.'000'; ?>).toLocaleDateString('fa-IR');  jQuery('.publishedon').text(pdate);</script>

Not the answer you're looking for? Browse other questions tagged or ask your own question.