Delete leading zeros from MX Calendar days

Delete leading zeros from MX Calendar days

To improve the look of the calendar and calendar nugger you can remove the leading zeros from dates between 01 and 09
divider

To improve the look of the calendar and calendar nugger you can remove the leading zeros from dates between 01 and 09

The process involves editing 3 files

  • includes\resources\CAL.res.php
    Add the following lines
$res = array(
'01'=>'1',
'02'=>'2',
'03'=>'3',
'04'=>'4',
'05'=>'5',
'06'=>'6',
'07'=>'7',
'08'=>'8',
'09'=>'9',
'Sunday' => 'Sunday',
............
  • includes/cal/CAL_ViewDay.class.php

Replace this

<?php echo CAL_getResource($this->data['nav']['title']['weekday']);?>, <?php echo CAL_getResource($this->data['nav']['title']['month']);?> <?php echo $this->data['nav']['title']['day'];?>, <?php echo $this->data['nav']['title']['year'];?>

with this

<?php echo CAL_getResource($this->data['nav']['title']['weekday']);?>, <?php echo CAL_getResource($this->data['nav']['title']['month']);?> <?php echo
CAL_getResource($this->data['nav']['title']['day']);?>,  <?php echo $this->data['nav']['title']['year'];?>
  • includes/cal/CAL_ViewWeek.class.php

Replace this

<?php echo CAL_getResource($this->data['nav']['title']['end']['month']);?> <?php echo $this->data['nav']['title']['end']['day'];?>

With this

<?php echo CAL_getResource($this->data['nav']['title']['end']['month']);?> <?php echo CAL_getResource($this->data['nav']['title']['end']['day']);?>
Written by:  - 9 Apr, 2010