From 5c26d01fabd905a1238eb08e3abfdf7a5c285627 Mon Sep 17 00:00:00 2001 From: Hisateru Tanaka Date: Tue, 17 Apr 2012 21:32:37 +0900 Subject: [PATCH] Change CldrCommand to use medium dateTimeFormat --- build/commands/CldrCommand.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/commands/CldrCommand.php b/build/commands/CldrCommand.php index 1942d23345..a7c70afea5 100644 --- a/build/commands/CldrCommand.php +++ b/build/commands/CldrCommand.php @@ -435,7 +435,16 @@ protected function parseDateTimeFormat($xml,&$data) $types=$xml->xpath('/ldml/dates/calendars/calendar[@type=\'gregorian\']/dateTimeFormats/dateTimeFormatLength'); if(is_array($types) && isset($types[0])) { - $pattern=$types[0]->xpath('dateTimeFormat/pattern'); + $picked = $types[0]; + foreach($types as $element) { + $attrs = $element->attributes(); + if($attrs['type'] == 'medium') + { + $picked = $element; + break; + } + } + $pattern=$picked->xpath('dateTimeFormat/pattern'); $data['dateTimeFormat']=(string)$pattern[0]; } }