1: <?php
2:
3: namespace Xoops\Core\Locale\Punic;
4:
5: /**
6: * Overrides for Punic\Calendar.
7: */
8: class Calendar extends \Punic\Calendar
9: {
10: /**
11: * Change to disable interpreteting 'yy' as forcing 2 digit year
12: *
13: * Instead of interpreting 2015 as '15' it will be '2015', while year 1 would be reported as '01'
14: *
15: * @param \DateTime $value
16: * @param $count
17: * @param $locale
18: * @return string
19: */
20: protected static function decodeYear(\DateTime $value, $count, $locale)
21: {
22: switch ($count) {
23: case 1:
24: return strval(intval($value->format('Y')));
25: case 2:
26: //return $value->format('y');
27: default:
28: $s = $value->format('Y');
29: if (!isset($s[$count])) {
30: $s = str_pad($s, $count, '0', STR_PAD_LEFT);
31: }
32:
33: return $s;
34: }
35: }
36: }
37: