| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011,2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011,2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 { | 327 { |
| 328 initializeLocaleData(); | 328 initializeLocaleData(); |
| 329 return m_decimalSymbols[DecimalSeparatorIndex]; | 329 return m_decimalSymbols[DecimalSeparatorIndex]; |
| 330 } | 330 } |
| 331 #endif | 331 #endif |
| 332 | 332 |
| 333 String Locale::formatDateTime(const DateComponents& date, FormatType formatType) | 333 String Locale::formatDateTime(const DateComponents& date, FormatType formatType) |
| 334 { | 334 { |
| 335 if (date.type() == DateComponents::Invalid) | 335 if (date.type() == DateComponents::Invalid) |
| 336 return String(); | 336 return String(); |
| 337 #if !ENABLE(INPUT_TYPE_WEEK) | |
| 338 if (date.type() == DateComponents::Week) | |
| 339 return String(); | |
| 340 #endif | |
| 341 | 337 |
| 342 DateTimeStringBuilder builder(*this, date); | 338 DateTimeStringBuilder builder(*this, date); |
| 343 switch (date.type()) { | 339 switch (date.type()) { |
| 344 case DateComponents::Time: | 340 case DateComponents::Time: |
| 345 builder.build(formatType == FormatTypeShort ? shortTimeFormat() : timeFo
rmat()); | 341 builder.build(formatType == FormatTypeShort ? shortTimeFormat() : timeFo
rmat()); |
| 346 break; | 342 break; |
| 347 case DateComponents::Date: | 343 case DateComponents::Date: |
| 348 builder.build(dateFormat()); | 344 builder.build(dateFormat()); |
| 349 break; | 345 break; |
| 350 case DateComponents::Month: | 346 case DateComponents::Month: |
| 351 builder.build(formatType == FormatTypeShort ? shortMonthFormat() : month
Format()); | 347 builder.build(formatType == FormatTypeShort ? shortMonthFormat() : month
Format()); |
| 352 break; | 348 break; |
| 353 case DateComponents::Week: | 349 case DateComponents::Week: |
| 354 #if ENABLE(INPUT_TYPE_WEEK) | |
| 355 builder.build(weekFormatInLDML()); | 350 builder.build(weekFormatInLDML()); |
| 356 break; | 351 break; |
| 357 #endif | |
| 358 case DateComponents::DateTime: | 352 case DateComponents::DateTime: |
| 359 case DateComponents::DateTimeLocal: | 353 case DateComponents::DateTimeLocal: |
| 360 builder.build(formatType == FormatTypeShort ? dateTimeFormatWithoutSecon
ds() : dateTimeFormatWithSeconds()); | 354 builder.build(formatType == FormatTypeShort ? dateTimeFormatWithoutSecon
ds() : dateTimeFormatWithSeconds()); |
| 361 break; | 355 break; |
| 362 case DateComponents::Invalid: | 356 case DateComponents::Invalid: |
| 363 ASSERT_NOT_REACHED(); | 357 ASSERT_NOT_REACHED(); |
| 364 break; | 358 break; |
| 365 } | 359 } |
| 366 return builder.toString(); | 360 return builder.toString(); |
| 367 } | 361 } |
| 368 | 362 |
| 369 } | 363 } |
| OLD | NEW |