summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
authorwei <>2006-02-19 22:25:23 +0000
committerwei <>2006-02-19 22:25:23 +0000
commit54572d1e4a5914e44bcd35fa9406ea72a8f2066f (patch)
tree3a8fc184f27cf06a3c1a768160579c6f26b3d599 /framework/Data
parentad8fced1af4eb8e6d57f8610273490aec0ac8cba (diff)
Update TRatingList and date picker.
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/TSimpleDateFormatter.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/framework/Data/TSimpleDateFormatter.php b/framework/Data/TSimpleDateFormatter.php
index d2f78b37..f6c04027 100644
--- a/framework/Data/TSimpleDateFormatter.php
+++ b/framework/Data/TSimpleDateFormatter.php
@@ -121,6 +121,47 @@ class TSimpleDateFormatter
return str_replace(array_keys($bits), $bits, $this->pattern);
}
+ public function getMonthPattern()
+ {
+ if(is_int(strpos($this->pattern, 'MMMM')))
+ return 'MMMM';
+ if(is_int(strpos($this->pattern, 'MMM')))
+ return 'MMM';
+ if(is_int(strpos($this->pattern, 'MM')))
+ return 'MM';
+ if(is_int(strpos($this->pattern, 'M')))
+ return 'M';
+ }
+
+ public function getDayPattern()
+ {
+ if(is_int(strpos($this->pattern, 'dd')))
+ return 'dd';
+ if(is_int(strpos($this->pattern, 'd')))
+ return 'd';
+ }
+
+ public function getYearPattern()
+ {
+ if(is_int(strpos($this->pattern, 'yyyy')))
+ return 'yyyy';
+ if(is_int(strpos($this->pattern, 'yy')))
+ return 'yy';
+ }
+
+ public function getDayMonthYearOrdering()
+ {
+ $ordering = array();
+ if(is_int($day= strpos($this->pattern, 'd')))
+ $ordering['day'] = $day;
+ if(is_int($month= strpos($this->pattern, 'M')))
+ $ordering['month'] = $month;
+ if(is_int($year= strpos($this->pattern, 'yy')))
+ $ordering['year'] = $year;
+ asort($ordering);
+ return array_keys($ordering);
+ }
+
/**
* Gets the time stamp from string or integer.
* @param string|int date to parse