Fredrik Roubert | 0596fae | 2017-04-18 21:34:02 +0200 | [diff] [blame] | 1 | // © 2016 and later: Unicode, Inc. and others. |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 2 | // License & terms of use: http://www.unicode.org/copyright.html |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 3 | /******************************************************************** |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 4 | * COPYRIGHT: |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 5 | * Copyright (c) 1997-2016, International Business Machines Corporation and |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 6 | * others. All Rights Reserved. |
| 7 | ********************************************************************/ |
| 8 | |
| 9 | #include "unicode/utypes.h" |
| 10 | |
| 11 | #if !UCONFIG_NO_FORMATTING |
| 12 | |
| 13 | |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 14 | //TODO: define it in compiler flag |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 15 | //#define DTIFMTTS_DEBUG 1 |
| 16 | |
| 17 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 18 | #ifdef DTIFMTTS_DEBUG |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 19 | #include <iostream> |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 20 | #endif |
| 21 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 22 | #include "dtifmtts.h" |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 23 | |
| 24 | #include "cmemory.h" |
| 25 | #include "cstr.h" |
| 26 | #include "cstring.h" |
| 27 | #include "simplethread.h" |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 28 | #include "japancal.h" |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 29 | #include "unicode/gregocal.h" |
| 30 | #include "unicode/dtintrv.h" |
| 31 | #include "unicode/dtitvinf.h" |
| 32 | #include "unicode/dtitvfmt.h" |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 33 | #include "unicode/localpointer.h" |
claireho | b26ce3a | 2012-01-10 17:54:41 -0800 | [diff] [blame] | 34 | #include "unicode/timezone.h" |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 35 | |
| 36 | |
| 37 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 38 | #ifdef DTIFMTTS_DEBUG |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 39 | //#define PRINTMESG(msg) { std::cout << "(" << __FILE__ << ":" << __LINE__ << ") " << msg << "\n"; } |
| 40 | #define PRINTMESG(msg) { std::cout << msg; } |
| 41 | #endif |
| 42 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 43 | #include <stdio.h> |
| 44 | |
| 45 | |
| 46 | void DateIntervalFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ ) { |
| 47 | if (exec) logln("TestSuite DateIntervalFormat"); |
| 48 | switch (index) { |
| 49 | TESTCASE(0, testAPI); |
| 50 | TESTCASE(1, testFormat); |
| 51 | TESTCASE(2, testFormatUserDII); |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 52 | TESTCASE(3, testSetIntervalPatternNoSideEffect); |
ccornelius | 59d709d | 2014-02-20 10:29:46 -0800 | [diff] [blame] | 53 | TESTCASE(4, testYearFormats); |
| 54 | TESTCASE(5, testStress); |
Fredrik Roubert | 1b7d32f | 2015-03-19 11:15:44 +0100 | [diff] [blame] | 55 | TESTCASE(6, testTicket11583_2); |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 56 | TESTCASE(7, testTicket11985); |
| 57 | TESTCASE(8, testTicket11669); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 58 | TESTCASE(9, testTicket12065); |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 59 | TESTCASE(10, testFormattedDateInterval); |
Nikita Iashchenko | ebc670d | 2020-01-02 14:35:08 +0000 | [diff] [blame] | 60 | TESTCASE(11, testCreateInstanceForAllLocales); |
Victor Chang | 8249390 | 2020-12-23 17:27:56 +0000 | [diff] [blame] | 61 | TESTCASE(12, testTicket20707); |
| 62 | TESTCASE(13, testFormatMillisecond); |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 63 | TESTCASE(14, testHourMetacharacters); |
| 64 | TESTCASE(15, testContext); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 65 | default: name = ""; break; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Test various generic API methods of DateIntervalFormat for API coverage. |
| 71 | */ |
| 72 | void DateIntervalFormatTest::testAPI() { |
| 73 | |
| 74 | /* ====== Test create interval instance with default locale and skeleton |
| 75 | */ |
| 76 | UErrorCode status = U_ZERO_ERROR; |
| 77 | logln("Testing DateIntervalFormat create instance with default locale and skeleton"); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 78 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 79 | DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, status); |
| 80 | if(U_FAILURE(status)) { |
| 81 | dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + default locale) - exitting"); |
| 82 | return; |
| 83 | } else { |
| 84 | delete dtitvfmt; |
| 85 | } |
| 86 | |
| 87 | |
| 88 | /* ====== Test create interval instance with given locale and skeleton |
| 89 | */ |
| 90 | status = U_ZERO_ERROR; |
| 91 | logln("Testing DateIntervalFormat create instance with given locale and skeleton"); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 92 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 93 | dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, Locale::getJapanese(), status); |
| 94 | if(U_FAILURE(status)) { |
| 95 | dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + locale) - exitting"); |
| 96 | return; |
| 97 | } else { |
| 98 | delete dtitvfmt; |
| 99 | } |
| 100 | |
| 101 | |
| 102 | /* ====== Test create interval instance with dateIntervalInfo and skeleton |
| 103 | */ |
| 104 | status = U_ZERO_ERROR; |
| 105 | logln("Testing DateIntervalFormat create instance with dateIntervalInfo and skeleton"); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 106 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 107 | DateIntervalInfo* dtitvinf = new DateIntervalInfo(Locale::getSimplifiedChinese(), status); |
| 108 | |
| 109 | dtitvfmt = DateIntervalFormat::createInstance("EEEdMMMyhms", *dtitvinf, status); |
| 110 | delete dtitvinf; |
| 111 | |
| 112 | if(U_FAILURE(status)) { |
| 113 | dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + DateIntervalInfo + default locale) - exitting"); |
| 114 | return; |
| 115 | } else { |
| 116 | delete dtitvfmt; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 117 | } |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 118 | |
| 119 | |
| 120 | /* ====== Test create interval instance with dateIntervalInfo and skeleton |
| 121 | */ |
| 122 | status = U_ZERO_ERROR; |
| 123 | logln("Testing DateIntervalFormat create instance with dateIntervalInfo and skeleton"); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 124 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 125 | dtitvinf = new DateIntervalInfo(Locale::getSimplifiedChinese(), status); |
| 126 | |
| 127 | dtitvfmt = DateIntervalFormat::createInstance("EEEdMMMyhms", Locale::getSimplifiedChinese(), *dtitvinf, status); |
| 128 | delete dtitvinf; |
| 129 | if(U_FAILURE(status)) { |
| 130 | dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + DateIntervalInfo + locale) - exitting"); |
| 131 | return; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 132 | } |
| 133 | // not deleted, test clone |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 134 | |
| 135 | |
| 136 | // ====== Test clone() |
| 137 | status = U_ZERO_ERROR; |
| 138 | logln("Testing DateIntervalFormat clone"); |
| 139 | |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 140 | DateIntervalFormat* another = dtitvfmt->clone(); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 141 | if ( (*another) != (*dtitvfmt) ) { |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 142 | dataerrln("%s:%d ERROR: clone failed", __FILE__, __LINE__); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 143 | } |
| 144 | |
claireho | 27f6547 | 2011-06-09 11:11:49 -0700 | [diff] [blame] | 145 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 146 | // ====== Test getDateIntervalInfo, setDateIntervalInfo, adoptDateIntervalInfo |
| 147 | status = U_ZERO_ERROR; |
| 148 | logln("Testing DateIntervalFormat getDateIntervalInfo"); |
| 149 | const DateIntervalInfo* inf = another->getDateIntervalInfo(); |
| 150 | dtitvfmt->setDateIntervalInfo(*inf, status); |
| 151 | const DateIntervalInfo* anotherInf = dtitvfmt->getDateIntervalInfo(); |
| 152 | if ( (*inf) != (*anotherInf) || U_FAILURE(status) ) { |
| 153 | dataerrln("ERROR: getDateIntervalInfo/setDateIntervalInfo failed"); |
| 154 | } |
| 155 | |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 156 | { |
| 157 | // We make sure that setDateIntervalInfo does not corrupt the cache. See ticket 9919. |
| 158 | status = U_ZERO_ERROR; |
| 159 | logln("Testing DateIntervalFormat setDateIntervalInfo"); |
| 160 | const Locale &enLocale = Locale::getEnglish(); |
| 161 | LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yMd", enLocale, status)); |
| 162 | if (U_FAILURE(status)) { |
| 163 | errln("Failure encountered: %s", u_errorName(status)); |
| 164 | return; |
| 165 | } |
| 166 | UnicodeString expected; |
| 167 | LocalPointer<Calendar> fromTime(Calendar::createInstance(enLocale, status)); |
| 168 | LocalPointer<Calendar> toTime(Calendar::createInstance(enLocale, status)); |
| 169 | if (U_FAILURE(status)) { |
| 170 | errln("Failure encountered: %s", u_errorName(status)); |
| 171 | return; |
| 172 | } |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 173 | FieldPosition pos(FieldPosition::DONT_CARE); |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 174 | fromTime->set(2013, 3, 26); |
| 175 | toTime->set(2013, 3, 28); |
| 176 | dif->format(*fromTime, *toTime, expected, pos, status); |
| 177 | if (U_FAILURE(status)) { |
| 178 | errln("Failure encountered: %s", u_errorName(status)); |
| 179 | return; |
| 180 | } |
Fredrik Roubert | 1b7d32f | 2015-03-19 11:15:44 +0100 | [diff] [blame] | 181 | LocalPointer<DateIntervalInfo> dii(new DateIntervalInfo(Locale::getEnglish(), status), status); |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 182 | if (U_FAILURE(status)) { |
| 183 | errln("Failure encountered: %s", u_errorName(status)); |
| 184 | return; |
| 185 | } |
| 186 | dii->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d"), status); |
| 187 | dif->setDateIntervalInfo(*dii, status); |
| 188 | if (U_FAILURE(status)) { |
| 189 | errln("Failure encountered: %s", u_errorName(status)); |
| 190 | return; |
| 191 | } |
| 192 | dif.adoptInstead(DateIntervalFormat::createInstance("yMd", enLocale, status)); |
| 193 | if (U_FAILURE(status)) { |
| 194 | errln("Failure encountered: %s", u_errorName(status)); |
| 195 | return; |
| 196 | } |
| 197 | UnicodeString actual; |
| 198 | pos = 0; |
| 199 | dif->format(*fromTime, *toTime, actual, pos, status); |
| 200 | if (U_FAILURE(status)) { |
| 201 | errln("Failure encountered: %s", u_errorName(status)); |
| 202 | return; |
| 203 | } |
| 204 | if (expected != actual) { |
| 205 | errln("DateIntervalFormat.setIntervalInfo should have no side effects."); |
| 206 | } |
| 207 | } |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 208 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 209 | /* |
| 210 | status = U_ZERO_ERROR; |
| 211 | DateIntervalInfo* nonConstInf = inf->clone(); |
| 212 | dtitvfmt->adoptDateIntervalInfo(nonConstInf, status); |
| 213 | anotherInf = dtitvfmt->getDateIntervalInfo(); |
| 214 | if ( (*inf) != (*anotherInf) || U_FAILURE(status) ) { |
| 215 | dataerrln("ERROR: adoptDateIntervalInfo failed"); |
| 216 | } |
| 217 | */ |
| 218 | |
| 219 | // ====== Test getDateFormat, setDateFormat, adoptDateFormat |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 220 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 221 | status = U_ZERO_ERROR; |
| 222 | logln("Testing DateIntervalFormat getDateFormat"); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 223 | /* |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 224 | const DateFormat* fmt = another->getDateFormat(); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 225 | dtitvfmt->setDateFormat(*fmt, status); |
| 226 | const DateFormat* anotherFmt = dtitvfmt->getDateFormat(); |
| 227 | if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) { |
| 228 | dataerrln("ERROR: getDateFormat/setDateFormat failed"); |
| 229 | } |
| 230 | |
| 231 | status = U_ZERO_ERROR; |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 232 | DateFormat* nonConstFmt = fmt->clone(); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 233 | dtitvfmt->adoptDateFormat(nonConstFmt, status); |
| 234 | anotherFmt = dtitvfmt->getDateFormat(); |
| 235 | if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) { |
| 236 | dataerrln("ERROR: adoptDateFormat failed"); |
| 237 | } |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 238 | delete fmt; |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 239 | */ |
| 240 | |
| 241 | |
| 242 | // ======= Test getStaticClassID() |
| 243 | |
| 244 | logln("Testing getStaticClassID()"); |
| 245 | |
| 246 | |
| 247 | if(dtitvfmt->getDynamicClassID() != DateIntervalFormat::getStaticClassID()) { |
| 248 | errln("ERROR: getDynamicClassID() didn't return the expected value"); |
| 249 | } |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 250 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 251 | delete another; |
| 252 | |
| 253 | // ====== test constructor/copy constructor and assignment |
| 254 | /* they are protected, no test |
| 255 | logln("Testing DateIntervalFormat constructor and assigment operator"); |
| 256 | status = U_ZERO_ERROR; |
| 257 | |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 258 | DateFormat* constFmt = dtitvfmt->getDateFormat()->clone(); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 259 | inf = dtitvfmt->getDateIntervalInfo()->clone(); |
| 260 | |
| 261 | |
| 262 | DateIntervalFormat* dtifmt = new DateIntervalFormat(fmt, inf, status); |
| 263 | if(U_FAILURE(status)) { |
| 264 | dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting"); |
| 265 | return; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 266 | } |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 267 | |
| 268 | DateIntervalFormat* dtifmt2 = new(dtifmt); |
| 269 | if ( (*dtifmt) != (*dtifmt2) ) { |
| 270 | dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting"); |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | DateIntervalFormat dtifmt3 = (*dtifmt); |
| 275 | if ( (*dtifmt) != dtifmt3 ) { |
| 276 | dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting"); |
| 277 | return; |
| 278 | } |
| 279 | |
| 280 | delete dtifmt2; |
| 281 | delete dtifmt3; |
| 282 | delete dtifmt; |
| 283 | */ |
| 284 | |
| 285 | |
| 286 | //===== test format and parse ================== |
| 287 | Formattable formattable; |
| 288 | formattable.setInt64(10); |
| 289 | UnicodeString res; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 290 | FieldPosition pos(FieldPosition::DONT_CARE); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 291 | status = U_ZERO_ERROR; |
| 292 | dtitvfmt->format(formattable, res, pos, status); |
| 293 | if ( status != U_ILLEGAL_ARGUMENT_ERROR ) { |
| 294 | dataerrln("ERROR: format non-date-interval object should set U_ILLEGAL_ARGUMENT_ERROR - exitting"); |
| 295 | return; |
| 296 | } |
| 297 | |
| 298 | DateInterval* dtitv = new DateInterval(3600*24*365, 3600*24*366); |
| 299 | formattable.adoptObject(dtitv); |
| 300 | res.remove(); |
| 301 | pos = 0; |
| 302 | status = U_ZERO_ERROR; |
| 303 | dtitvfmt->format(formattable, res, pos, status); |
| 304 | if ( U_FAILURE(status) ) { |
| 305 | dataerrln("ERROR: format date interval failed - exitting"); |
| 306 | return; |
| 307 | } |
| 308 | |
| 309 | const DateFormat* dfmt = dtitvfmt->getDateFormat(); |
| 310 | Calendar* fromCal = dfmt->getCalendar()->clone(); |
| 311 | Calendar* toCal = dfmt->getCalendar()->clone(); |
| 312 | res.remove(); |
| 313 | pos = 0; |
| 314 | status = U_ZERO_ERROR; |
| 315 | dtitvfmt->format(*fromCal, *toCal, res, pos, status); |
| 316 | if ( U_FAILURE(status) ) { |
| 317 | dataerrln("ERROR: format date interval failed - exitting"); |
| 318 | return; |
| 319 | } |
| 320 | delete fromCal; |
| 321 | delete toCal; |
| 322 | |
| 323 | |
| 324 | Formattable fmttable; |
| 325 | status = U_ZERO_ERROR; |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 326 | // TODO: why do I need cast? |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 327 | ((Format*)dtitvfmt)->parseObject(res, fmttable, status); |
| 328 | if ( status != U_INVALID_FORMAT_ERROR ) { |
| 329 | dataerrln("ERROR: parse should set U_INVALID_FORMAT_ERROR - exitting"); |
| 330 | return; |
| 331 | } |
| 332 | |
| 333 | delete dtitvfmt; |
| 334 | |
claireho | b26ce3a | 2012-01-10 17:54:41 -0800 | [diff] [blame] | 335 | //====== test setting time zone |
| 336 | logln("Testing DateIntervalFormat set & format with different time zones, get time zone"); |
| 337 | status = U_ZERO_ERROR; |
| 338 | dtitvfmt = DateIntervalFormat::createInstance("MMMdHHmm", Locale::getEnglish(), status); |
| 339 | if ( U_SUCCESS(status) ) { |
| 340 | UDate date1 = 1299090600000.0; // 2011-Mar-02 1030 in US/Pacific, 2011-Mar-03 0330 in Asia/Tokyo |
| 341 | UDate date2 = 1299115800000.0; // 2011-Mar-02 1730 in US/Pacific, 2011-Mar-03 1030 in Asia/Tokyo |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 342 | |
claireho | b26ce3a | 2012-01-10 17:54:41 -0800 | [diff] [blame] | 343 | DateInterval * dtitv12 = new DateInterval(date1, date2); |
| 344 | TimeZone * tzCalif = TimeZone::createTimeZone("US/Pacific"); |
| 345 | TimeZone * tzTokyo = TimeZone::createTimeZone("Asia/Tokyo"); |
ccornelius | 59d709d | 2014-02-20 10:29:46 -0800 | [diff] [blame] | 346 | UnicodeString fmtCalif = UnicodeString(ctou("Mar 2, 10:30 \\u2013 17:30")); |
| 347 | UnicodeString fmtTokyo = UnicodeString(ctou("Mar 3, 03:30 \\u2013 10:30")); |
claireho | b26ce3a | 2012-01-10 17:54:41 -0800 | [diff] [blame] | 348 | |
| 349 | dtitvfmt->adoptTimeZone(tzCalif); |
| 350 | res.remove(); |
| 351 | pos = 0; |
| 352 | status = U_ZERO_ERROR; |
| 353 | dtitvfmt->format(dtitv12, res, pos, status); |
| 354 | if ( U_SUCCESS(status) ) { |
| 355 | if ( res.compare(fmtCalif) != 0 ) { |
| 356 | errln("ERROR: DateIntervalFormat::format for tzCalif, expect " + fmtCalif + ", get " + res); |
| 357 | } |
| 358 | } else { |
| 359 | errln("ERROR: DateIntervalFormat::format for tzCalif, status %s", u_errorName(status)); |
| 360 | } |
| 361 | |
| 362 | dtitvfmt->setTimeZone(*tzTokyo); |
| 363 | res.remove(); |
| 364 | pos = 0; |
| 365 | status = U_ZERO_ERROR; |
| 366 | dtitvfmt->format(dtitv12, res, pos, status); |
| 367 | if ( U_SUCCESS(status) ) { |
| 368 | if ( res.compare(fmtTokyo) != 0 ) { |
| 369 | errln("ERROR: DateIntervalFormat::format for fmtTokyo, expect " + fmtTokyo + ", get " + res); |
| 370 | } |
| 371 | } else { |
| 372 | errln("ERROR: DateIntervalFormat::format for tzTokyo, status %s", u_errorName(status)); |
| 373 | } |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 374 | |
claireho | b26ce3a | 2012-01-10 17:54:41 -0800 | [diff] [blame] | 375 | if ( dtitvfmt->getTimeZone() != *tzTokyo ) { |
| 376 | errln("ERROR: DateIntervalFormat::getTimeZone returns mismatch."); |
| 377 | } |
| 378 | |
| 379 | delete tzTokyo; // tzCalif was owned by dtitvfmt which should have deleted it |
| 380 | delete dtitv12; |
| 381 | delete dtitvfmt; |
| 382 | } else { |
| 383 | errln("ERROR: DateIntervalFormat::createInstance(\"MdHH\", Locale::getEnglish(), ...), status %s", u_errorName(status)); |
| 384 | } |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 385 | //====== test format in testFormat() |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 386 | |
claireho | 50294ea | 2010-05-03 15:44:48 -0700 | [diff] [blame] | 387 | //====== test DateInterval class (better coverage) |
| 388 | DateInterval dtitv1(3600*24*365, 3600*24*366); |
| 389 | DateInterval dtitv2(dtitv1); |
| 390 | |
| 391 | if (!(dtitv1 == dtitv2)) { |
| 392 | errln("ERROR: Copy constructor failed for DateInterval."); |
| 393 | } |
| 394 | |
| 395 | DateInterval dtitv3(3600*365, 3600*366); |
| 396 | dtitv3 = dtitv1; |
| 397 | if (!(dtitv3 == dtitv1)) { |
| 398 | errln("ERROR: Equal operator failed for DateInterval."); |
| 399 | } |
| 400 | |
| 401 | DateInterval *dtitv4 = dtitv1.clone(); |
| 402 | if (*dtitv4 != dtitv1) { |
| 403 | errln("ERROR: Equal operator failed for DateInterval."); |
| 404 | } |
| 405 | delete dtitv4; |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | |
| 409 | /** |
| 410 | * Test format |
| 411 | */ |
| 412 | void DateIntervalFormatTest::testFormat() { |
| 413 | // first item is date pattern |
| 414 | // followed by a group of locale/from_data/to_data/skeleton/interval_data |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 415 | // Note that from_data/to_data are specified using era names from root, for the calendar specified by locale. |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 416 | const char* DATA[] = { |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 417 | "GGGGG y MM dd HH:mm:ss", // pattern for from_data/to_data |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 418 | // test root |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 419 | "root", "CE 2007 11 10 10:10:10", "CE 2007 12 10 10:10:10", "yM", "2007-11 \\u2013 2007-12", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 420 | |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 421 | // test 'H' and 'h', using availableFormat in fallback |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 422 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 10 15:10:10", "Hms", "10:10:10 \\u2013 15:10:10", |
| 423 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 10 15:10:10", "hms", "10:10:10 AM \\u2013 3:10:10 PM", |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 424 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 425 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "MMMM", "October 2007 \\u2013 October 2008", |
| 426 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "MMM", "Oct 2007 \\u2013 Oct 2008", |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 427 | // test skeleton with both date and time |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 428 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 AM \\u2013 Nov 20, 2007, 10:10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 429 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 430 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 10 11:10:10", "dMMMyhm", "Nov 10, 2007, 10:10 \\u2013 11:10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 431 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 432 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 10 11:10:10", "hms", "10:10:10 AM \\u2013 11:10:10 AM", |
| 433 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 10 11:10:10", "Hms", "10:10:10 \\u2013 11:10:10", |
| 434 | "en", "CE 2007 11 10 20:10:10", "CE 2007 11 10 21:10:10", "Hms", "20:10:10 \\u2013 21:10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 435 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 436 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 437 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 438 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMMMMy", "October 10, 2007 \\u2013 October 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 439 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 440 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMMMM", "October 10, 2007 \\u2013 October 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 441 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 442 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "MMMMy", "October 2007 \\u2013 October 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 443 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 444 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 445 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 446 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EdMMMy", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 447 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 448 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMMMy", "Oct 10, 2007 \\u2013 Oct 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 449 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 450 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMMM", "Oct 10, 2007 \\u2013 Oct 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 451 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 452 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "MMMy", "Oct 2007 \\u2013 Oct 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 453 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 454 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EdMMM", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 455 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 456 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EdMy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 457 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 458 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMy", "10/10/2007 \\u2013 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 459 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 460 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dM", "10/10/2007 \\u2013 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 461 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 462 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "My", "10/2007 \\u2013 10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 463 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 464 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EdM", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 465 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 466 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "d", "10/10/2007 \\u2013 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 467 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 468 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "Ed", "10 Wed \\u2013 10 Fri", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 469 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 470 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "y", "2007 \\u2013 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 471 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 472 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "M", "10/2007 \\u2013 10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 473 | |
| 474 | |
| 475 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 476 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hm", "10/10/2007, 10:10 AM \\u2013 10/10/2008, 10:10 AM", |
| 477 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "Hm", "10/10/2007, 10:10 \\u2013 10/10/2008, 10:10", |
| 478 | "en", "CE 2007 10 10 20:10:10", "CE 2008 10 10 20:10:10", "Hm", "10/10/2007, 20:10 \\u2013 10/10/2008, 20:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 479 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 480 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT \\u2013 10/10/2008, 10:10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 481 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 482 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT \\u2013 10/10/2008, 10:10 AM PDT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 483 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 484 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "h", "10/10/2007, 10 AM \\u2013 10/10/2008, 10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 485 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 486 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hv", "10/10/2007, 10 AM PT \\u2013 10/10/2008, 10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 487 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 488 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hz", "10/10/2007, 10 AM PDT \\u2013 10/10/2008, 10 AM PDT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 489 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 490 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 491 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 492 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EddMMy", "Wed, 10/10/2007 \\u2013 Fri, 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 493 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 494 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hhmm", "10/10/2007, 10:10 AM \\u2013 10/10/2008, 10:10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 495 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 496 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT \\u2013 10/10/2008, 10:10 AM PDT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 497 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 498 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM \\u2013 10/10/2008, 10:10:10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 499 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 500 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMMMMMy", "O 10, 2007 \\u2013 O 10, 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 501 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 502 | "en", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EEEEEdM", "W, 10/10/2007 \\u2013 F, 10/10/2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 503 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 504 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10 \\u2013 Saturday, November 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 505 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 506 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMMMy", "October 10 \\u2013 November 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 507 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 508 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMMM", "October 10 \\u2013 November 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 509 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 510 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMMMy", "October \\u2013 November 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 511 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 512 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10 \\u2013 Saturday, November 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 513 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 514 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EdMMMy", "Wed, Oct 10 \\u2013 Sat, Nov 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 515 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 516 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMMy", "Oct 10 \\u2013 Nov 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 517 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 518 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMM", "Oct 10 \\u2013 Nov 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 519 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 520 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMMy", "Oct \\u2013 Nov 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 521 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 522 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EdMMM", "Wed, Oct 10 \\u2013 Sat, Nov 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 523 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 524 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EdMy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 525 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 526 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMy", "10/10/2007 \\u2013 11/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 527 | |
| 528 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 529 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "My", "10/2007 \\u2013 11/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 530 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 531 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EdM", "Wed, 10/10 \\u2013 Sat, 11/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 532 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 533 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "d", "10/10 \\u2013 11/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 534 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 535 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "Ed", "10 Wed \\u2013 10 Sat", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 536 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 537 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 538 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 539 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "M", "10 \\u2013 11", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 540 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 541 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMM", "Oct \\u2013 Nov", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 542 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 543 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMMM", "October \\u2013 November", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 544 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 545 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hm", "10/10/2007, 10:10 AM \\u2013 11/10/2007, 10:10 AM", |
| 546 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "Hm", "10/10/2007, 10:10 \\u2013 11/10/2007, 10:10", |
| 547 | "en", "CE 2007 10 10 20:10:10", "CE 2007 11 10 20:10:10", "Hm", "10/10/2007, 20:10 \\u2013 11/10/2007, 20:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 548 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 549 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hmv", "10/10/2007, 10:10 AM PT \\u2013 11/10/2007, 10:10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 550 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 551 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hmz", "10/10/2007, 10:10 AM PDT \\u2013 11/10/2007, 10:10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 552 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 553 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "h", "10/10/2007, 10 AM \\u2013 11/10/2007, 10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 554 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 555 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hv", "10/10/2007, 10 AM PT \\u2013 11/10/2007, 10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 556 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 557 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hz", "10/10/2007, 10 AM PDT \\u2013 11/10/2007, 10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 558 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 559 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 560 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 561 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EddMMy", "Wed, 10/10/2007 \\u2013 Sat, 11/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 562 | |
| 563 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 564 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hhmmzz", "10/10/2007, 10:10 AM PDT \\u2013 11/10/2007, 10:10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 565 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 566 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hms", "10/10/2007, 10:10:10 AM \\u2013 11/10/2007, 10:10:10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 567 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 568 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMMMMy", "O 10 \\u2013 N 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 569 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 570 | "en", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EEEEEdM", "W, 10/10 \\u2013 S, 11/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 571 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 572 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEdMMMMy", "Saturday, November 10 \\u2013 Tuesday, November 20, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 573 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 574 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMMy", "November 10 \\u2013 20, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 575 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 576 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMM", "November 10 \\u2013 20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 577 | |
| 578 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 579 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEdMMMM", "Saturday, November 10 \\u2013 Tuesday, November 20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 580 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 581 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdMMMy", "Sat, Nov 10 \\u2013 Tue, Nov 20, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 582 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 583 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMy", "Nov 10 \\u2013 20, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 584 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 585 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMM", "Nov 10 \\u2013 20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 586 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 587 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "MMMy", "Nov 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 588 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 589 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdMMM", "Sat, Nov 10 \\u2013 Tue, Nov 20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 590 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 591 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdMy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 592 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 593 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMy", "11/10/2007 \\u2013 11/20/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 594 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 595 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 596 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 597 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "My", "11/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 598 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 599 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdM", "Sat, 11/10 \\u2013 Tue, 11/20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 600 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 601 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "d", "10 \\u2013 20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 602 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 603 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "Ed", "10 Sat \\u2013 20 Tue", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 604 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 605 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 606 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 607 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "M", "11", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 608 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 609 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "MMM", "Nov", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 610 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 611 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "MMMM", "November", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 612 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 613 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hm", "11/10/2007, 10:10 AM \\u2013 11/20/2007, 10:10 AM", |
| 614 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "Hm", "11/10/2007, 10:10 \\u2013 11/20/2007, 10:10", |
| 615 | "en", "CE 2007 11 10 20:10:10", "CE 2007 11 20 20:10:10", "Hm", "11/10/2007, 20:10 \\u2013 11/20/2007, 20:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 616 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 617 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hmv", "11/10/2007, 10:10 AM PT \\u2013 11/20/2007, 10:10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 618 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 619 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hmz", "11/10/2007, 10:10 AM PST \\u2013 11/20/2007, 10:10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 620 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 621 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "h", "11/10/2007, 10 AM \\u2013 11/20/2007, 10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 622 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 623 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hv", "11/10/2007, 10 AM PT \\u2013 11/20/2007, 10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 624 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 625 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hz", "11/10/2007, 10 AM PST \\u2013 11/20/2007, 10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 626 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 627 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEddMMyyyy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 628 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 629 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EddMMy", "Sat, 11/10/2007 \\u2013 Tue, 11/20/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 630 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 631 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hhmm", "11/10/2007, 10:10 AM \\u2013 11/20/2007, 10:10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 632 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 633 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hhmmzz", "11/10/2007, 10:10 AM PST \\u2013 11/20/2007, 10:10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 634 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 635 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hms", "11/10/2007, 10:10:10 AM \\u2013 11/20/2007, 10:10:10 AM", |
| 636 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "Hms", "11/10/2007, 10:10:10 \\u2013 11/20/2007, 10:10:10", |
| 637 | "en", "CE 2007 11 10 20:10:10", "CE 2007 11 20 20:10:10", "Hms", "11/10/2007, 20:10:10 \\u2013 11/20/2007, 20:10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 638 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 639 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMMMy", "N 10 \\u2013 20, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 640 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 641 | "en", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEEdM", "S, 11/10 \\u2013 T, 11/20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 642 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 643 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEEEdMMMMy", "Wednesday, January 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 644 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 645 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMMMMy", "January 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 646 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 647 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMMMM", "January 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 648 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 649 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "MMMMy", "January 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 650 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 651 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEEEdMMMM", "Wednesday, January 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 652 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 653 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EdMMMy", "Wed, Jan 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 654 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 655 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMMMy", "Jan 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 656 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 657 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMMM", "Jan 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 658 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 659 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "MMMy", "Jan 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 660 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 661 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EdMMM", "Wed, Jan 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 662 | |
| 663 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 664 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMy", "1/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 665 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 666 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dM", "1/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 667 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 668 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "My", "1/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 669 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 670 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EdM", "Wed, 1/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 671 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 672 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "d", "10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 673 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 674 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "Ed", "10 Wed", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 675 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 676 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 677 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 678 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "M", "1", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 679 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 680 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "MMM", "Jan", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 681 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 682 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "MMMM", "January", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 683 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 684 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hm", "10:00 AM \\u2013 2:10 PM", |
| 685 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "Hm", "10:00 \\u2013 14:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 686 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 687 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hmv", "10:00 AM \\u2013 2:10 PM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 688 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 689 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hmz", "10:00 AM \\u2013 2:10 PM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 690 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 691 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "h", "10 AM \\u2013 2 PM", |
| 692 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "H", "10 \\u2013 14", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 693 | |
| 694 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 695 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hz", "10 AM \\u2013 2 PM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 696 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 697 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEddMMyyyy", "Wed, 01/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 698 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 699 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EddMMy", "Wed, 01/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 700 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 701 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hhmm", "10:00 AM \\u2013 2:10 PM", |
| 702 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "HHmm", "10:00 \\u2013 14:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 703 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 704 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hhmmzz", "10:00 AM \\u2013 2:10 PM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 705 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 706 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hms", "10:00:10 AM \\u2013 2:10:10 PM", |
| 707 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "Hms", "10:00:10 \\u2013 14:10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 708 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 709 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMMMMMy", "J 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 710 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 711 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEEEEdM", "W, 1/10", |
| 712 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "dMMMMy", "January 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 713 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 714 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "dMMMM", "January 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 715 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 716 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "MMMMy", "January 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 717 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 718 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EEEEdMMMM", "Wednesday, January 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 719 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 720 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EdMMMy", "Wed, Jan 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 721 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 722 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "dMMMy", "Jan 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 723 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 724 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "dMMM", "Jan 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 725 | |
| 726 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 727 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EdMMM", "Wed, Jan 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 728 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 729 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EdMy", "Wed, 1/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 730 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 731 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "dMy", "1/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 732 | |
| 733 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 734 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "My", "1/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 735 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 736 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EdM", "Wed, 1/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 737 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 738 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "d", "10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 739 | |
| 740 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 741 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 742 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 743 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "M", "1", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 744 | |
| 745 | |
| 746 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 747 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hm", "10:00 \\u2013 10:20 AM", |
| 748 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "Hm", "10:00 \\u2013 10:20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 749 | |
| 750 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 751 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hmz", "10:00 \\u2013 10:20 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 752 | |
| 753 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 754 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hv", "10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 755 | |
| 756 | |
| 757 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 758 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EddMMy", "Wed, 01/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 759 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 760 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hhmm", "10:00 \\u2013 10:20 AM", |
| 761 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "HHmm", "10:00 \\u2013 10:20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 762 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 763 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hhmmzz", "10:00 \\u2013 10:20 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 764 | |
| 765 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 766 | "en", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "dMMMMMy", "J 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 767 | |
| 768 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 769 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EEEEdMMMMy", "Wednesday, January 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 770 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 771 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "dMMMMy", "January 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 772 | |
| 773 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 774 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "MMMMy", "January 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 775 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 776 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EEEEdMMMM", "Wednesday, January 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 777 | |
| 778 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 779 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "dMMMy", "Jan 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 780 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 781 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "dMMM", "Jan 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 782 | |
| 783 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 784 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EdMMM", "Wed, Jan 10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 785 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 786 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EdMy", "Wed, 1/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 787 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 788 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "dMy", "1/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 789 | |
| 790 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 791 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "My", "1/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 792 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 793 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EdM", "Wed, 1/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 794 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 795 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "d", "10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 796 | |
| 797 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 798 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 799 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 800 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "M", "1", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 801 | |
| 802 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 803 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "MMMM", "January", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 804 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 805 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hm", "10:10 AM", |
| 806 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "Hm", "10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 807 | |
| 808 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 809 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hmz", "10:10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 810 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 811 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "h", "10 AM", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 812 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 813 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hv", "10 AM PT", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 814 | |
| 815 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 816 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EEddMMyyyy", "Wed, 01/10/2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 817 | |
| 818 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 819 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hhmm", "10:10 AM", |
| 820 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "HHmm", "10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 821 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 822 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hhmmzz", "10:10 AM PST", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 823 | |
| 824 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 825 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "dMMMMMy", "J 10, 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 826 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 827 | "en", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EEEEEdM", "W, 1/10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 828 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 829 | "zh", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EEEEdMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e94", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 830 | |
| 831 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 832 | "zh", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 833 | |
| 834 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 835 | "zh", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMMMy", "2007\\u5e7410\\u6708\\u81f311\\u6708", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 836 | |
| 837 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 838 | "zh", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hmv", "2007/10/10\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10 \\u2013 2007/11/10\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 839 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 840 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEdMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 841 | |
| 842 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 843 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMM", "11\\u670810\\u65e5\\u81f320\\u65e5", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 844 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 845 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "MMMMy", "2007\\u5E7411\\u6708", // (fixed expected result per ticket:6626:) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 846 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 847 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEdMMMM", "11\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 848 | |
| 849 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 850 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdMy", "2007/11/10\\u5468\\u516d\\u81f32007/11/20\\u5468\\u4e8c", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 851 | |
| 852 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 853 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 854 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 855 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "My", "2007\\u5E7411\\u6708", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 856 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 857 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdM", "11/10\\u5468\\u516d\\u81f311/20\\u5468\\u4e8c", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 858 | |
| 859 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 860 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "y", "2007\\u5E74", // (fixed expected result per ticket:6626:) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 861 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 862 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "M", "11\\u6708", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 863 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 864 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "MMM", "11\\u6708", // (fixed expected result per ticket:6626: and others) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 865 | |
| 866 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 867 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hmz", "2007/11/10GMT-8 \\u4e0a\\u534810:10 \\u2013 2007/11/20GMT-8 \\u4e0a\\u534810:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 868 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 869 | "zh", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "h", "2007/11/10\\u4e0a\\u534810\\u65f6 \\u2013 2007/11/20\\u4e0a\\u534810\\u65f6", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 870 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 871 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEEEdMMMMy", "2007\\u5e741\\u670810\\u65e5\\u661f\\u671f\\u4e09", // (fixed expected result per ticket:6626:) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 872 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 873 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hm", "\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 874 | |
| 875 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 876 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hmz", "GMT-8 \\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 877 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 878 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "h", "\\u4e0a\\u534810\\u65F6\\u81f3\\u4e0b\\u53482\\u65f6", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 879 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 880 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "hv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810\\u65F6\\u81F3\\u4E0B\\u53482\\u65F6", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 881 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 882 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hm", "\\u4e0a\\u534810:00\\u81f310:20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 883 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 884 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hmv", "\\u6D1B\\u6749\\u77F6\\u65F6\\u95F4 \\u4E0A\\u534810:00\\u81F310:20", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 885 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 886 | "zh", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hz", "GMT-8\\u4e0a\\u534810\\u65f6", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 887 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 888 | "zh", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hm", "\\u4e0a\\u534810:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 889 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 890 | "zh", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "h", "\\u4e0a\\u534810\\u65f6", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 891 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 892 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. 2007 \\u2013 Freitag, 10. Okt. 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 893 | |
| 894 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 895 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMMM", "10. Okt. 2007 \\u2013 10. Okt. 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 896 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 897 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "MMMy", "Okt. 2007 \\u2013 Okt. 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 898 | |
| 899 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 900 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EdMy", "Mi., 10.10.2007 \\u2013 Fr., 10.10.2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 901 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 902 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "dMy", "10.10.2007 \\u2013 10.10.2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 903 | |
| 904 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 905 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "My", "10.2007 \\u2013 10.2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 906 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 907 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "EdM", "Mi., 10.10.2007 \\u2013 Fr., 10.10.2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 908 | |
| 909 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 910 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "y", "2007\\u20132008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 911 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 912 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "M", "10.2007 \\u2013 10.2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 913 | |
| 914 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 915 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "hm", "10.10.2007, 10:10 AM \\u2013 10.10.2008, 10:10 AM", |
| 916 | "de", "CE 2007 10 10 10:10:10", "CE 2008 10 10 10:10:10", "Hm", "10.10.2007, 10:10 \\u2013 10.10.2008, 10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 917 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 918 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. \\u2013 Samstag, 10. Nov. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 919 | |
| 920 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 921 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dMMM", "10. Okt. \\u2013 10. Nov.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 922 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 923 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMMy", "Okt.\\u2013Nov. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 924 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 925 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "EEEEdMMM", "Mittwoch, 10. Okt. \\u2013 Samstag, 10. Nov.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 926 | |
| 927 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 928 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "dM", "10.10. \\u2013 10.11.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 929 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 930 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "My", "10.2007 \\u2013 11.2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 931 | |
| 932 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 933 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "d", "10.10. \\u2013 10.11.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 934 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 935 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 936 | |
| 937 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 938 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "MMM", "Okt.\\u2013Nov.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 939 | |
| 940 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 941 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 AM \\u2013 10.11.2007, 10:10:10 AM", |
| 942 | "de", "CE 2007 10 10 10:10:10", "CE 2007 11 10 10:10:10", "Hms", "10.10.2007, 10:10:10 \\u2013 10.11.2007, 10:10:10", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 943 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 944 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEdMMMy", "Samstag, 10. \\u2013 Dienstag, 20. Nov. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 945 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 946 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dMMMy", "10.\\u201320. Nov. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 947 | |
| 948 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 949 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "MMMy", "Nov. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 950 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 951 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EEEEdMMM", "Samstag, 10. \\u2013 Dienstag, 20. Nov.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 952 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 953 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "EdMy", "Sa., 10. \\u2013 Di., 20.11.2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 954 | |
| 955 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 956 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "dM", "10.\\u201320.11.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 957 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 958 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "My", "11.2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 959 | |
| 960 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 961 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "d", "10.\\u201320.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 962 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 963 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "y", "2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 964 | |
| 965 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 966 | "de", "CE 2007 11 10 10:10:10", "CE 2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 AM Los Angeles Zeit \\u2013 20.11.2007, 10:10 AM Los Angeles Zeit", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 967 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 968 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 969 | |
| 970 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 971 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "dMMM", "10. Jan.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 972 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 973 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "MMMy", "Jan. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 974 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 975 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "EEEEdMMM", "Mittwoch, 10. Jan.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 976 | |
| 977 | /* Following is an important test, because the 'h' in 'Uhr' is interpreted as a pattern |
| 978 | if not escaped properly. */ |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 979 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "h", "10 Uhr AM \\u2013 2 Uhr PM", |
| 980 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 14:10:10", "H", "10\\u201314 Uhr", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 981 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 982 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "EEEEdMMM", "Mittwoch, 10. Jan.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 983 | |
| 984 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 985 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hmv", "10:00\\u201310:20 AM Los Angeles Zeit", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 986 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 987 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hmz", "10:00\\u201310:20 AM GMT-8", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 988 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 989 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "h", "10 Uhr AM", |
| 990 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "H", "10 Uhr", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 991 | |
| 992 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 993 | "de", "CE 2007 01 10 10:00:10", "CE 2007 01 10 10:20:10", "hz", "10 Uhr AM GMT-8", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 994 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 995 | "de", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 996 | |
| 997 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 998 | "de", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hmv", "10:10 AM Los Angeles Zeit", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 999 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1000 | "de", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hmz", "10:10 AM GMT-8", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1001 | |
| 1002 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1003 | "de", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hv", "10 Uhr AM Los Angeles Zeit", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1004 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1005 | "de", "CE 2007 01 10 10:10:10", "CE 2007 01 10 10:10:20", "hz", "10 Uhr AM GMT-8", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1006 | |
claireho | 50294ea | 2010-05-03 15:44:48 -0700 | [diff] [blame] | 1007 | // Thai (default calendar buddhist) |
| 1008 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1009 | // BEGIN ANDROID-changed. Default calendar in Android is Gregorian for th locale. |
| 1010 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2550 \\u2013 \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. 2551", |
Fredrik Roubert | 1b7d32f | 2015-03-19 11:15:44 +0100 | [diff] [blame] | 1011 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1012 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1013 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 \\u2013 10 \\u0E15.\\u0E04. 2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1014 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1015 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 \\u2013 \\u0E15.\\u0E04. 2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1016 | |
| 1017 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1018 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1019 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1020 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "dMy", "10/10/2550 \\u2013 10/10/2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1021 | |
| 1022 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1023 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "My", "10/2550 \\u2013 10/2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1024 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1025 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/10/2550 \\u2013 \\u0E28. 10/10/2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1026 | |
| 1027 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1028 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "y", "2550\\u20132551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1029 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1030 | // "th", "BE 2550 10 10 10:10:10", "BE 2551 10 10 10:10:10", "M", "10/2550 \\u2013 10/2551", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1031 | |
| 1032 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1033 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18\\u0E17\\u0E35\\u0E48 10 \\u0E15.\\u0E04. \\u2013 \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48 10 \\u0E1E.\\u0E22. 2550", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1034 | |
| 1035 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1036 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. \\u2013 10 \\u0E1E.\\u0E22.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1037 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1038 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22. 2550", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1039 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1040 | // "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 \\u2013 10/11", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1041 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1042 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "My", "10/2550 \\u2013 11/2550", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1043 | |
| 1044 | |
Victor Chang | 89ae847 | 2021-03-16 18:05:01 +0000 | [diff] [blame^] | 1045 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "d", "10/10 \\u2013 10/11", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1046 | |
Victor Chang | 89ae847 | 2021-03-16 18:05:01 +0000 | [diff] [blame^] | 1047 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "y", "\\u0E1E.\\u0E28. 2550", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1048 | |
| 1049 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1050 | // "th", "BE 2550 10 10 10:10:10", "BE 2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22.", |
| 1051 | |
| 1052 | // "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "\\u0E1E.\\u0E28. 2550", |
| 1053 | |
| 1054 | // "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0E04.\\u2013\\u0E1E.\\u0E22.", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1055 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1056 | // Tests for Japanese calendar with eras, including new era in 2019 (Heisei 31 through April 30, then new era) |
| 1057 | |
| 1058 | "en-u-ca-japanese", "H 31 03 15 09:00:00", "H 31 04 15 09:00:00", "GyMMMd", "Mar 15 \\u2013 Apr 15, 31 Heisei", |
| 1059 | |
| 1060 | "en-u-ca-japanese", "H 31 03 15 09:00:00", "H 31 04 15 09:00:00", "GGGGGyMd", "3/15/31 \\u2013 4/15/31 H", |
| 1061 | |
| 1062 | "en-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GyMMMd", "Jan 5, 64 Sh\\u014Dwa \\u2013 Jan 15, 1 Heisei", |
| 1063 | |
| 1064 | "en-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GGGGGyMd", "1/5/64 S \\u2013 1/15/1 H", |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1065 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1066 | "en-u-ca-japanese", "H 31 04 15 09:00:00", JP_ERA_2019_NARROW " 1 05 15 09:00:00", "GyMMMd", "Apr 15, 31 Heisei \\u2013 May 15, 1 " JP_ERA_2019_ROOT, |
| 1067 | |
| 1068 | "en-u-ca-japanese", "H 31 04 15 09:00:00", JP_ERA_2019_NARROW " 1 05 15 09:00:00", "GGGGGyMd", "4/15/31 H \\u2013 5/15/1 " JP_ERA_2019_NARROW, |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1069 | |
| 1070 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1071 | "ja-u-ca-japanese", "H 31 03 15 09:00:00", "H 31 04 15 09:00:00", "GyMMMd", "\\u5E73\\u621031\\u5E743\\u670815\\u65E5\\uFF5E4\\u670815\\u65E5", |
| 1072 | |
| 1073 | "ja-u-ca-japanese", "H 31 03 15 09:00:00", "H 31 04 15 09:00:00", "GGGGGyMd", "H31/03/15\\uFF5E31/04/15", |
| 1074 | |
| 1075 | "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GyMMMd", "\\u662D\\u548C64\\u5E741\\u67085\\u65E5\\uFF5E\\u5E73\\u6210\\u5143\\u5E741\\u670815\\u65E5", |
| 1076 | |
| 1077 | "ja-u-ca-japanese", "S 64 01 05 09:00:00", "H 1 01 15 09:00:00", "GGGGGyMd", "S64/01/05\\uFF5EH1/01/15", |
| 1078 | |
| 1079 | "ja-u-ca-japanese", "H 31 04 15 09:00:00", JP_ERA_2019_NARROW " 1 05 15 09:00:00", "GGGGGyMd", "H31/04/15\\uFF5E" JP_ERA_2019_NARROW "1/05/15", |
| 1080 | |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1081 | // END ANDROID-changed |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1082 | }; |
Victor Chang | 39491dd | 2021-01-19 10:18:27 +0000 | [diff] [blame] | 1083 | // Android patch: b/145129186 Disable failing tests |
| 1084 | #ifndef ANDROID |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1085 | expect(DATA, UPRV_LENGTHOF(DATA)); |
Victor Chang | 39491dd | 2021-01-19 10:18:27 +0000 | [diff] [blame] | 1086 | #endif /* ANDROID */ |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1087 | } |
| 1088 | |
| 1089 | |
| 1090 | /** |
| 1091 | * Test handling of hour and day period metacharacters |
| 1092 | */ |
| 1093 | void DateIntervalFormatTest::testHourMetacharacters() { |
| 1094 | // first item is date pattern |
| 1095 | // followed by a group of locale/from_data/to_data/skeleton/interval_data |
| 1096 | // Note that from_data/to_data are specified using era names from root, for the calendar specified by locale. |
| 1097 | const char* DATA[] = { |
| 1098 | "GGGGG y MM dd HH:mm:ss", // pattern for from_data/to_data |
| 1099 | |
| 1100 | // This test is for tickets ICU-21154, ICU-21155, and ICU-21156 and is intended to verify |
| 1101 | // that all of the special skeleton characters for hours and day periods work as expected |
| 1102 | // with date intervals: |
| 1103 | // - If a, b, or B is included in the skeleton, it correctly sets the length of the day-period field |
| 1104 | // - If k or K is included, it behaves the same as H or h, except for the difference in the actual |
| 1105 | // number used for the hour. |
| 1106 | // - If j is included, it behaves the same as either h or H as appropriate, and multiple j's have the |
| 1107 | // intended effect on the length of the day period field (if there is one) |
| 1108 | // - If J is included, it correctly suppresses the day period field if j would include it |
| 1109 | // - If C is included, it behaves the same as j and brings up the correct day period field |
| 1110 | // - In all cases, if the day period of both ends of the range is the same, you only see it once |
| 1111 | |
| 1112 | // baseline (h and H) |
| 1113 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "hh", "12 \\u2013 1 AM", |
| 1114 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "HH", "00\\u201301 Uhr", |
| 1115 | |
| 1116 | // k and K (ICU-21154 and ICU-21156) |
| 1117 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "KK", "0 \\u2013 1 AM", |
| 1118 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "kk", "24\\u201301 Uhr", |
| 1119 | |
| 1120 | // different lengths of the 'a' field |
| 1121 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "ha", "10 AM \\u2013 1 PM", |
| 1122 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "ha", "12 \\u2013 1 AM", |
| 1123 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 12:00:00", "haaaaa", "10 a \\u2013 12 p", |
| 1124 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "haaaaa", "12 \\u2013 1 a", |
| 1125 | |
| 1126 | // j (ICU-21155) |
| 1127 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "jj", "10 AM \\u2013 1 PM", |
| 1128 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "jj", "12 \\u2013 1 AM", |
| 1129 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "jjjjj", "10 a \\u2013 1 p", |
| 1130 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "jjjjj", "12 \\u2013 1 a", |
| 1131 | "de", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "jj", "10\\u201313 Uhr", |
| 1132 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "jj", "00\\u201301 Uhr", |
| 1133 | "de", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "jjjjj", "10\\u201313 Uhr", |
| 1134 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "jjjjj", "00\\u201301 Uhr", |
| 1135 | |
| 1136 | // b and B |
| 1137 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 12:00:00", "hb", "10 AM \\u2013 12 noon", |
| 1138 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 12:00:00", "hbbbbb", "10 a \\u2013 12 n", |
| 1139 | "en", "CE 2010 09 27 13:00:00", "CE 2010 09 27 14:00:00", "hb", "1 \\u2013 2 PM", |
| 1140 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "hB", "10 in the morning \\u2013 1 in the afternoon", |
| 1141 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "hB", "12 \\u2013 1 at night", |
| 1142 | |
| 1143 | // J |
| 1144 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "J", "10 \\u2013 1", |
| 1145 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "J", "12 \\u2013 1", |
| 1146 | "de", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "J", "10\\u201313 Uhr", |
| 1147 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "J", "00\\u201301 Uhr", |
| 1148 | |
| 1149 | // C |
| 1150 | // (for English and German, C should do the same thing as j) |
| 1151 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "CC", "10 AM \\u2013 1 PM", |
| 1152 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "CC", "12 \\u2013 1 AM", |
| 1153 | "en", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "CCCCC", "10 a \\u2013 1 p", |
| 1154 | "en", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "CCCCC", "12 \\u2013 1 a", |
| 1155 | "de", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "CC", "10\\u201313 Uhr", |
| 1156 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "CC", "00\\u201301 Uhr", |
| 1157 | "de", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "CCCCC", "10\\u201313 Uhr", |
| 1158 | "de", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "CCCCC", "00\\u201301 Uhr", |
| 1159 | // (for zh_HK and hi_IN, j maps to ha, but C maps to hB) |
| 1160 | "zh_HK", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "jj", "\\u4E0A\\u534810\\u6642\\u81F3\\u4E0B\\u53481\\u6642", |
| 1161 | "zh_HK", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "jj", "\\u4E0A\\u534812\\u6642\\u81F31\\u6642", |
| 1162 | "zh_HK", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "hB", "\\u4E0A\\u534810\\u6642 \\u2013 \\u4E0B\\u53481\\u6642", |
| 1163 | "zh_HK", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "hB", "\\u51CC\\u666812\\u20131\\u6642", |
| 1164 | "zh_HK", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "CC", "\\u4E0A\\u534810\\u6642 \\u2013 \\u4E0B\\u53481\\u6642", |
| 1165 | "zh_HK", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "CC", "\\u51CC\\u666812\\u20131\\u6642", |
| 1166 | "hi_IN", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "jj", "10 am \\u2013 1 pm", |
| 1167 | "hi_IN", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "jj", "12\\u20131 am", |
| 1168 | "hi_IN", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "hB", "\\u0938\\u0941\\u092C\\u0939 10 \\u2013 \\u0926\\u094B\\u092A\\u0939\\u0930 1", |
| 1169 | "hi_IN", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "hB", "\\u0930\\u093E\\u0924 12\\u20131", |
| 1170 | "hi_IN", "CE 2010 09 27 10:00:00", "CE 2010 09 27 13:00:00", "CC", "\\u0938\\u0941\\u092C\\u0939 10 \\u2013 \\u0926\\u094B\\u092A\\u0939\\u0930 1", |
| 1171 | "hi_IN", "CE 2010 09 27 00:00:00", "CE 2010 09 27 01:00:00", "CC", "\\u0930\\u093E\\u0924 12\\u20131", |
| 1172 | |
| 1173 | // regression test for ICU-21342 |
| 1174 | "en_GB", "CE 2010 09 27 00:00:00", "CE 2010 09 27 10:00:00", "kk", "24\\u201310", |
| 1175 | "en_GB", "CE 2010 09 27 00:00:00", "CE 2010 09 27 11:00:00", "kk", "24\\u201311", |
| 1176 | "en_GB", "CE 2010 09 27 00:00:00", "CE 2010 09 27 12:00:00", "kk", "24\\u201312", |
| 1177 | "en_GB", "CE 2010 09 27 00:00:00", "CE 2010 09 27 13:00:00", "kk", "24\\u201313", |
| 1178 | |
| 1179 | // regression test for ICU-21343 |
| 1180 | "de", "CE 2010 09 27 01:00:00", "CE 2010 09 27 10:00:00", "KK", "1 \\u2013 10 Uhr AM", |
| 1181 | }; |
| 1182 | expect(DATA, UPRV_LENGTHOF(DATA)); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1183 | } |
| 1184 | |
| 1185 | |
| 1186 | void DateIntervalFormatTest::expect(const char** data, int32_t data_length) { |
| 1187 | int32_t i = 0; |
| 1188 | UErrorCode ec = U_ZERO_ERROR; |
| 1189 | UnicodeString str, str2; |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1190 | const char* pattern = data[i++]; |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1191 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1192 | while (i<data_length) { |
| 1193 | const char* locName = data[i++]; |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1194 | const char* datestr = data[i++]; |
| 1195 | const char* datestr_2 = data[i++]; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1196 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1197 | Locale loc(locName); |
| 1198 | LocalPointer<Calendar> defCal(Calendar::createInstance(loc, ec)); |
| 1199 | if (U_FAILURE(ec)) { |
| 1200 | dataerrln("Calendar::createInstance fails for loc %s with: %s", locName, u_errorName(ec)); |
| 1201 | return; |
| 1202 | } |
| 1203 | const char* calType = defCal->getType(); |
Victor Chang | 18ad09d | 2021-01-19 10:17:23 +0000 | [diff] [blame] | 1204 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1205 | Locale refLoc("root"); |
| 1206 | if (calType) { |
| 1207 | refLoc.setKeywordValue("calendar", calType, ec); |
| 1208 | } |
| 1209 | SimpleDateFormat ref(pattern, refLoc, ec); |
| 1210 | logln( "case %d, locale: %s\n", (i-1)/5, locName); |
claireho | 50294ea | 2010-05-03 15:44:48 -0700 | [diff] [blame] | 1211 | if (U_FAILURE(ec)) { |
| 1212 | dataerrln("contruct SimpleDateFormat in expect failed: %s", u_errorName(ec)); |
| 1213 | return; |
| 1214 | } |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1215 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1216 | // 'f' |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1217 | logln("original date: %s - %s\n", datestr, datestr_2); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1218 | UDate date = ref.parse(ctou(datestr), ec); |
| 1219 | if (!assertSuccess("parse 1st data in expect", ec)) return; |
| 1220 | UDate date_2 = ref.parse(ctou(datestr_2), ec); |
| 1221 | if (!assertSuccess("parse 2nd data in expect", ec)) return; |
| 1222 | DateInterval dtitv(date, date_2); |
| 1223 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1224 | const UnicodeString& oneSkeleton(ctou(data[i++])); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1225 | |
| 1226 | DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(oneSkeleton, loc, ec); |
| 1227 | if (!assertSuccess("createInstance(skeleton) in expect", ec)) return; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1228 | FieldPosition pos(FieldPosition::DONT_CARE); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1229 | dtitvfmt->format(&dtitv, str.remove(), pos, ec); |
| 1230 | if (!assertSuccess("format in expect", ec)) return; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1231 | assertEquals((UnicodeString)"\"" + locName + "\\" + oneSkeleton + "\\" + ctou(datestr) + "\\" + ctou(datestr_2) + "\"", ctou(data[i++]), str); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1232 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1233 | logln("interval date:" + str + "\"" + locName + "\", " |
| 1234 | + "\"" + datestr + "\", " |
| 1235 | + "\"" + datestr_2 + "\", " + oneSkeleton); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1236 | delete dtitvfmt; |
| 1237 | } |
| 1238 | } |
| 1239 | |
| 1240 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1241 | /* |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1242 | * Test format using user defined DateIntervalInfo |
| 1243 | */ |
| 1244 | void DateIntervalFormatTest::testFormatUserDII() { |
| 1245 | // first item is date pattern |
| 1246 | const char* DATA[] = { |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1247 | "yyyy MM dd HH:mm:ss", |
| 1248 | "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Oct 10, 2007 --- Oct 10, 2008", |
| 1249 | |
| 1250 | "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Oct 10 - Nov 2007", |
| 1251 | |
| 1252 | "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Nov 10, 2007 --- Nov 20, 2007", |
| 1253 | |
| 1254 | "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007", |
| 1255 | |
| 1256 | "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007", |
| 1257 | |
| 1258 | "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007", |
| 1259 | |
| 1260 | "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "2007\\u5e7410\\u670810\\u65e5 --- 2008\\u5e7410\\u670810\\u65e5", |
| 1261 | |
| 1262 | "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 10\\u6708 10 - 11\\u6708 2007", |
| 1263 | |
| 1264 | "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007\\u5e7411\\u670810\\u65e5 --- 2007\\u5e7411\\u670820\\u65e5", |
| 1265 | |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 1266 | "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1267 | |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 1268 | "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1269 | |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 1270 | "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:) |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1271 | |
| 1272 | "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt. 2007 --- 10. Okt. 2008", |
| 1273 | |
| 1274 | |
| 1275 | "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov. 2007 --- 20. Nov. 2007", |
| 1276 | |
| 1277 | "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan. 2007", |
| 1278 | |
| 1279 | "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan. 2007", |
| 1280 | |
| 1281 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1282 | "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 oct 2007 --- 10 oct 2008", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1283 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1284 | "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct 10 - nov 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1285 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1286 | "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 nov 2007 --- 20 nov 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1287 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1288 | "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 ene 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1289 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1290 | "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 ene 2007", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1291 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1292 | "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 ene 2007", |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1293 | }; |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1294 | expectUserDII(DATA, UPRV_LENGTHOF(DATA)); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1295 | } |
| 1296 | |
Victor Chang | 978167a | 2021-01-18 17:56:33 +0000 | [diff] [blame] | 1297 | /* |
| 1298 | * Test format using UDisplayContext |
| 1299 | */ |
| 1300 | #define CAP_NONE UDISPCTX_CAPITALIZATION_NONE |
| 1301 | #define CAP_BEGIN UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE |
| 1302 | #define CAP_LIST UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU |
| 1303 | #define CAP_ALONE UDISPCTX_CAPITALIZATION_FOR_STANDALONE |
| 1304 | #define _DAY (24.0*60.0*60.0*1000.0) |
| 1305 | |
| 1306 | void DateIntervalFormatTest::testContext() { |
| 1307 | static const UDate startDate = 1285599629000.0; // 2010-Sep-27 0800 in America/Los_Angeles |
| 1308 | typedef struct { |
| 1309 | const char * locale; |
| 1310 | const char * skeleton; |
| 1311 | UDisplayContext context; |
| 1312 | const UDate deltaDate; |
| 1313 | const UChar* expectResult; |
| 1314 | } DateIntervalContextItem; |
| 1315 | static const DateIntervalContextItem testItems[] = { |
| 1316 | { "cs", "MMMEd", CAP_NONE, 60.0*_DAY, u"po 27. 9. – pá 26. 11." }, |
| 1317 | { "cs", "yMMMM", CAP_NONE, 60.0*_DAY, u"září–listopad 2010" }, |
| 1318 | { "cs", "yMMMM", CAP_NONE, 1.0*_DAY, u"září 2010" }, |
| 1319 | #if !UCONFIG_NO_BREAK_ITERATION |
| 1320 | { "cs", "MMMEd", CAP_BEGIN, 60.0*_DAY, u"Po 27. 9. – pá 26. 11." }, |
| 1321 | { "cs", "yMMMM", CAP_BEGIN, 60.0*_DAY, u"Září–listopad 2010" }, |
| 1322 | { "cs", "yMMMM", CAP_BEGIN, 1.0*_DAY, u"Září 2010" }, |
| 1323 | { "cs", "MMMEd", CAP_LIST, 60.0*_DAY, u"Po 27. 9. – pá 26. 11." }, |
| 1324 | { "cs", "yMMMM", CAP_LIST, 60.0*_DAY, u"Září–listopad 2010" }, |
| 1325 | { "cs", "yMMMM", CAP_LIST, 1.0*_DAY, u"Září 2010" }, |
| 1326 | #endif |
| 1327 | { "cs", "MMMEd", CAP_ALONE, 60.0*_DAY, u"po 27. 9. – pá 26. 11." }, |
| 1328 | { "cs", "yMMMM", CAP_ALONE, 60.0*_DAY, u"září–listopad 2010" }, |
| 1329 | { "cs", "yMMMM", CAP_ALONE, 1.0*_DAY, u"září 2010" }, |
| 1330 | { nullptr, nullptr, CAP_NONE, 0, nullptr } |
| 1331 | }; |
| 1332 | const DateIntervalContextItem* testItemPtr; |
| 1333 | for ( testItemPtr = testItems; testItemPtr->locale != nullptr; ++testItemPtr ) { |
| 1334 | UErrorCode status = U_ZERO_ERROR; |
| 1335 | Locale locale(testItemPtr->locale); |
| 1336 | UnicodeString skeleton(testItemPtr->skeleton, -1, US_INV); |
| 1337 | LocalPointer<DateIntervalFormat> fmt(DateIntervalFormat::createInstance(skeleton, locale, status)); |
| 1338 | if (U_FAILURE(status)) { |
| 1339 | errln("createInstance failed for locale %s skeleton %s: %s", |
| 1340 | testItemPtr->locale, testItemPtr->skeleton, u_errorName(status)); |
| 1341 | continue; |
| 1342 | } |
| 1343 | fmt->adoptTimeZone(TimeZone::createTimeZone("America/Los_Angeles")); |
| 1344 | |
| 1345 | fmt->setContext(testItemPtr->context, status); |
| 1346 | if (U_FAILURE(status)) { |
| 1347 | errln("setContext failed for locale %s skeleton %s context %04X: %s", |
| 1348 | testItemPtr->locale, testItemPtr->skeleton, (unsigned)testItemPtr->context, u_errorName(status)); |
| 1349 | } else { |
| 1350 | UDisplayContext getContext = fmt->getContext(UDISPCTX_TYPE_CAPITALIZATION, status); |
| 1351 | if (U_FAILURE(status)) { |
| 1352 | errln("getContext failed for locale %s skeleton %s context %04X: %s", |
| 1353 | testItemPtr->locale, testItemPtr->skeleton, (unsigned)testItemPtr->context, u_errorName(status)); |
| 1354 | } else if (getContext != testItemPtr->context) { |
| 1355 | errln("getContext failed for locale %s skeleton %s context %04X: got context %04X", |
| 1356 | testItemPtr->locale, testItemPtr->skeleton, (unsigned)testItemPtr->context, (unsigned)getContext); |
| 1357 | } |
| 1358 | } |
| 1359 | |
| 1360 | status = U_ZERO_ERROR; |
| 1361 | DateInterval interval(startDate, startDate + testItemPtr->deltaDate); |
| 1362 | UnicodeString getResult; |
| 1363 | FieldPosition pos(FieldPosition::DONT_CARE); |
| 1364 | fmt->format(&interval, getResult, pos, status); |
| 1365 | if (U_FAILURE(status)) { |
| 1366 | errln("format failed for locale %s skeleton %s context %04X: %s", |
| 1367 | testItemPtr->locale, testItemPtr->skeleton, (unsigned)testItemPtr->context, u_errorName(status)); |
| 1368 | continue; |
| 1369 | } |
| 1370 | UnicodeString expectResult(true, testItemPtr->expectResult, -1); |
| 1371 | if (getResult != expectResult) { |
| 1372 | errln(UnicodeString("format expected ") + expectResult + UnicodeString(" but got ") + getResult); |
| 1373 | } |
| 1374 | } |
| 1375 | } |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1376 | |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 1377 | void DateIntervalFormatTest::testSetIntervalPatternNoSideEffect() { |
| 1378 | UErrorCode ec = U_ZERO_ERROR; |
Fredrik Roubert | 1b7d32f | 2015-03-19 11:15:44 +0100 | [diff] [blame] | 1379 | LocalPointer<DateIntervalInfo> dtitvinf(new DateIntervalInfo(ec), ec); |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 1380 | if (U_FAILURE(ec)) { |
| 1381 | errln("Failure encountered: %s", u_errorName(ec)); |
| 1382 | return; |
| 1383 | } |
| 1384 | UnicodeString expected; |
| 1385 | dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, expected, ec); |
| 1386 | dtitvinf->setIntervalPattern(ctou("yMd"), UCAL_DATE, ctou("M/d/y \\u2013 d"), ec); |
| 1387 | if (U_FAILURE(ec)) { |
| 1388 | errln("Failure encountered: %s", u_errorName(ec)); |
| 1389 | return; |
| 1390 | } |
Fredrik Roubert | 1b7d32f | 2015-03-19 11:15:44 +0100 | [diff] [blame] | 1391 | dtitvinf.adoptInsteadAndCheckErrorCode(new DateIntervalInfo(ec), ec); |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 1392 | if (U_FAILURE(ec)) { |
| 1393 | errln("Failure encountered: %s", u_errorName(ec)); |
| 1394 | return; |
| 1395 | } |
| 1396 | UnicodeString actual; |
| 1397 | dtitvinf->getIntervalPattern(ctou("yMd"), UCAL_DATE, actual, ec); |
| 1398 | if (U_FAILURE(ec)) { |
| 1399 | errln("Failure encountered: %s", u_errorName(ec)); |
| 1400 | return; |
| 1401 | } |
| 1402 | if (expected != actual) { |
| 1403 | errln("DateIntervalInfo.setIntervalPattern should have no side effects."); |
| 1404 | } |
| 1405 | } |
| 1406 | |
ccornelius | 59d709d | 2014-02-20 10:29:46 -0800 | [diff] [blame] | 1407 | void DateIntervalFormatTest::testYearFormats() { |
| 1408 | const Locale &enLocale = Locale::getEnglish(); |
| 1409 | UErrorCode status = U_ZERO_ERROR; |
| 1410 | LocalPointer<Calendar> fromTime(Calendar::createInstance(enLocale, status)); |
| 1411 | LocalPointer<Calendar> toTime(Calendar::createInstance(enLocale, status)); |
| 1412 | if (U_FAILURE(status)) { |
| 1413 | errln("Failure encountered: %s", u_errorName(status)); |
| 1414 | return; |
| 1415 | } |
| 1416 | // April 26, 113. Three digit year so that we can test 2 digit years; |
| 1417 | // 4 digit years with padded 0's and full years. |
| 1418 | fromTime->set(113, 3, 26); |
| 1419 | // April 28, 113. |
| 1420 | toTime->set(113, 3, 28); |
| 1421 | { |
| 1422 | LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yyyyMd", enLocale, status)); |
| 1423 | if (U_FAILURE(status)) { |
| 1424 | dataerrln("Failure encountered: %s", u_errorName(status)); |
| 1425 | return; |
| 1426 | } |
| 1427 | UnicodeString actual; |
| 1428 | UnicodeString expected(ctou("4/26/0113 \\u2013 4/28/0113")); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1429 | FieldPosition pos; |
ccornelius | 59d709d | 2014-02-20 10:29:46 -0800 | [diff] [blame] | 1430 | dif->format(*fromTime, *toTime, actual, pos, status); |
| 1431 | if (U_FAILURE(status)) { |
| 1432 | errln("Failure encountered: %s", u_errorName(status)); |
| 1433 | return; |
| 1434 | } |
| 1435 | if (actual != expected) { |
| 1436 | errln("Expected " + expected + ", got: " + actual); |
| 1437 | } |
| 1438 | } |
| 1439 | { |
| 1440 | LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yyMd", enLocale, status)); |
| 1441 | if (U_FAILURE(status)) { |
| 1442 | errln("Failure encountered: %s", u_errorName(status)); |
| 1443 | return; |
| 1444 | } |
| 1445 | UnicodeString actual; |
| 1446 | UnicodeString expected(ctou("4/26/13 \\u2013 4/28/13")); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1447 | FieldPosition pos(FieldPosition::DONT_CARE); |
ccornelius | 59d709d | 2014-02-20 10:29:46 -0800 | [diff] [blame] | 1448 | dif->format(*fromTime, *toTime, actual, pos, status); |
| 1449 | if (U_FAILURE(status)) { |
| 1450 | errln("Failure encountered: %s", u_errorName(status)); |
| 1451 | return; |
| 1452 | } |
| 1453 | if (actual != expected) { |
| 1454 | errln("Expected " + expected + ", got: " + actual); |
| 1455 | } |
| 1456 | } |
| 1457 | { |
| 1458 | LocalPointer<DateIntervalFormat> dif(DateIntervalFormat::createInstance("yMd", enLocale, status)); |
| 1459 | if (U_FAILURE(status)) { |
| 1460 | errln("Failure encountered: %s", u_errorName(status)); |
| 1461 | return; |
| 1462 | } |
| 1463 | UnicodeString actual; |
| 1464 | UnicodeString expected(ctou("4/26/113 \\u2013 4/28/113")); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1465 | FieldPosition pos(FieldPosition::DONT_CARE); |
ccornelius | 59d709d | 2014-02-20 10:29:46 -0800 | [diff] [blame] | 1466 | dif->format(*fromTime, *toTime, actual, pos, status); |
| 1467 | if (U_FAILURE(status)) { |
| 1468 | errln("Failure encountered: %s", u_errorName(status)); |
| 1469 | return; |
| 1470 | } |
| 1471 | if (actual != expected) { |
| 1472 | errln("Expected " + expected + ", got: " + actual); |
| 1473 | } |
| 1474 | } |
| 1475 | } |
Craig Cornelius | 8393335 | 2013-06-14 14:20:29 -0700 | [diff] [blame] | 1476 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1477 | void DateIntervalFormatTest::expectUserDII(const char** data, |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1478 | int32_t data_length) { |
| 1479 | int32_t i = 0; |
| 1480 | UnicodeString str; |
| 1481 | UErrorCode ec = U_ZERO_ERROR; |
| 1482 | const char* pattern = data[0]; |
| 1483 | i++; |
| 1484 | |
| 1485 | while ( i < data_length ) { |
| 1486 | const char* locName = data[i++]; |
| 1487 | Locale loc(locName); |
| 1488 | SimpleDateFormat ref(pattern, loc, ec); |
claireho | 50294ea | 2010-05-03 15:44:48 -0700 | [diff] [blame] | 1489 | if (U_FAILURE(ec)) { |
| 1490 | dataerrln("contruct SimpleDateFormat in expectUserDII failed: %s", u_errorName(ec)); |
| 1491 | return; |
| 1492 | } |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1493 | const char* datestr = data[i++]; |
| 1494 | const char* datestr_2 = data[i++]; |
| 1495 | UDate date = ref.parse(ctou(datestr), ec); |
| 1496 | if (!assertSuccess("parse in expectUserDII", ec)) return; |
| 1497 | UDate date_2 = ref.parse(ctou(datestr_2), ec); |
| 1498 | if (!assertSuccess("parse in expectUserDII", ec)) return; |
| 1499 | DateInterval dtitv(date, date_2); |
| 1500 | |
| 1501 | ec = U_ZERO_ERROR; |
| 1502 | // test user created DateIntervalInfo |
| 1503 | DateIntervalInfo* dtitvinf = new DateIntervalInfo(ec); |
| 1504 | dtitvinf->setFallbackIntervalPattern("{0} --- {1}", ec); |
| 1505 | dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_MONTH, "yyyy MMM d - MMM y",ec); |
| 1506 | if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return; |
| 1507 | dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_HOUR_OF_DAY, "yyyy MMM d HH:mm - HH:mm", ec); |
| 1508 | if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return; |
| 1509 | DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_ABBR_MONTH_DAY, loc, *dtitvinf, ec); |
| 1510 | delete dtitvinf; |
| 1511 | if (!assertSuccess("createInstance(skeleton,dtitvinf) in expectUserDII", ec)) return; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1512 | FieldPosition pos(FieldPosition::DONT_CARE); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1513 | dtitvfmt->format(&dtitv, str.remove(), pos, ec); |
| 1514 | if (!assertSuccess("format in expectUserDII", ec)) return; |
| 1515 | assertEquals((UnicodeString)"\"" + locName + "\\" + datestr + "\\" + datestr_2 + "\"", ctou(data[i++]), str); |
| 1516 | #ifdef DTIFMTTS_DEBUG |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1517 | char result[1000]; |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1518 | char mesg[1000]; |
| 1519 | PRINTMESG("interval format using user defined DateIntervalInfo\n"); |
| 1520 | str.extract(0, str.length(), result, "UTF-8"); |
| 1521 | sprintf(mesg, "interval date: %s\n", result); |
| 1522 | PRINTMESG(mesg); |
| 1523 | #endif |
| 1524 | delete dtitvfmt; |
| 1525 | } |
| 1526 | } |
| 1527 | |
| 1528 | |
| 1529 | void DateIntervalFormatTest::testStress() { |
Jean-Baptiste Queru | b0ac937 | 2009-07-20 15:09:32 -0700 | [diff] [blame] | 1530 | if(quick){ |
| 1531 | logln("Quick mode: Skipping test"); |
| 1532 | return; |
| 1533 | } |
| 1534 | const char* DATA[] = { |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1535 | "yyyy MM dd HH:mm:ss", |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1536 | "2007 10 10 10:10:10", "2008 10 10 10:10:10", |
| 1537 | "2007 10 10 10:10:10", "2007 11 10 10:10:10", |
| 1538 | "2007 11 10 10:10:10", "2007 11 20 10:10:10", |
| 1539 | "2007 01 10 10:00:10", "2007 01 10 14:10:10", |
| 1540 | "2007 01 10 10:00:10", "2007 01 10 10:20:10", |
| 1541 | "2007 01 10 10:10:10", "2007 01 10 10:10:20", |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1542 | }; |
| 1543 | |
| 1544 | const char* testLocale[][3] = { |
| 1545 | //{"th", "", ""}, |
| 1546 | {"en", "", ""}, |
| 1547 | {"zh", "", ""}, |
| 1548 | {"de", "", ""}, |
| 1549 | {"ar", "", ""}, |
| 1550 | {"en", "GB", ""}, |
| 1551 | {"fr", "", ""}, |
| 1552 | {"it", "", ""}, |
| 1553 | {"nl", "", ""}, |
| 1554 | {"zh", "TW", ""}, |
| 1555 | {"ja", "", ""}, |
| 1556 | {"pt", "BR", ""}, |
| 1557 | {"ru", "", ""}, |
| 1558 | {"pl", "", ""}, |
| 1559 | {"tr", "", ""}, |
| 1560 | {"es", "", ""}, |
| 1561 | {"ko", "", ""}, |
| 1562 | {"sv", "", ""}, |
| 1563 | {"fi", "", ""}, |
| 1564 | {"da", "", ""}, |
| 1565 | {"pt", "PT", ""}, |
| 1566 | {"ro", "", ""}, |
| 1567 | {"hu", "", ""}, |
| 1568 | {"he", "", ""}, |
| 1569 | {"in", "", ""}, |
| 1570 | {"cs", "", ""}, |
| 1571 | {"el", "", ""}, |
| 1572 | {"no", "", ""}, |
| 1573 | {"vi", "", ""}, |
| 1574 | {"bg", "", ""}, |
| 1575 | {"hr", "", ""}, |
| 1576 | {"lt", "", ""}, |
| 1577 | {"sk", "", ""}, |
| 1578 | {"sl", "", ""}, |
| 1579 | {"sr", "", ""}, |
| 1580 | {"ca", "", ""}, |
| 1581 | {"lv", "", ""}, |
| 1582 | {"uk", "", ""}, |
| 1583 | {"hi", "", ""}, |
| 1584 | }; |
| 1585 | |
| 1586 | uint32_t localeIndex; |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1587 | for ( localeIndex = 0; localeIndex < UPRV_LENGTHOF(testLocale); ++localeIndex ) { |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1588 | char locName[32]; |
| 1589 | uprv_strcpy(locName, testLocale[localeIndex][0]); |
| 1590 | uprv_strcat(locName, testLocale[localeIndex][1]); |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1591 | stress(DATA, UPRV_LENGTHOF(DATA), Locale(testLocale[localeIndex][0], testLocale[localeIndex][1], testLocale[localeIndex][2]), locName); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1592 | } |
| 1593 | } |
| 1594 | |
| 1595 | |
| 1596 | void DateIntervalFormatTest::stress(const char** data, int32_t data_length, |
| 1597 | const Locale& loc, const char* locName) { |
| 1598 | UnicodeString skeleton[] = { |
| 1599 | "EEEEdMMMMy", |
| 1600 | "dMMMMy", |
| 1601 | "dMMMM", |
| 1602 | "MMMMy", |
| 1603 | "EEEEdMMMM", |
| 1604 | "EdMMMy", |
| 1605 | "dMMMy", |
| 1606 | "dMMM", |
| 1607 | "MMMy", |
| 1608 | "EdMMM", |
| 1609 | "EdMy", |
| 1610 | "dMy", |
| 1611 | "dM", |
| 1612 | "My", |
| 1613 | "EdM", |
| 1614 | "d", |
| 1615 | "Ed", |
| 1616 | "y", |
| 1617 | "M", |
| 1618 | "MMM", |
| 1619 | "MMMM", |
| 1620 | "hm", |
| 1621 | "hmv", |
| 1622 | "hmz", |
| 1623 | "h", |
| 1624 | "hv", |
| 1625 | "hz", |
| 1626 | "EEddMMyyyy", // following could be normalized |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1627 | "EddMMy", |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1628 | "hhmm", |
| 1629 | "hhmmzz", |
| 1630 | "hms", // following could not be normalized |
| 1631 | "dMMMMMy", |
| 1632 | "EEEEEdM", |
| 1633 | }; |
| 1634 | |
| 1635 | int32_t i = 0; |
| 1636 | UErrorCode ec = U_ZERO_ERROR; |
| 1637 | UnicodeString str, str2; |
| 1638 | SimpleDateFormat ref(data[i++], loc, ec); |
| 1639 | if (!assertSuccess("construct SimpleDateFormat", ec)) return; |
| 1640 | |
| 1641 | #ifdef DTIFMTTS_DEBUG |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1642 | char result[1000]; |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1643 | char mesg[1000]; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1644 | sprintf(mesg, "locale: %s\n", locName); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1645 | PRINTMESG(mesg); |
| 1646 | #endif |
| 1647 | |
| 1648 | while (i<data_length) { |
| 1649 | |
| 1650 | // 'f' |
| 1651 | const char* datestr = data[i++]; |
| 1652 | const char* datestr_2 = data[i++]; |
| 1653 | #ifdef DTIFMTTS_DEBUG |
| 1654 | sprintf(mesg, "original date: %s - %s\n", datestr, datestr_2); |
| 1655 | PRINTMESG(mesg) |
| 1656 | #endif |
| 1657 | UDate date = ref.parse(ctou(datestr), ec); |
| 1658 | if (!assertSuccess("parse", ec)) return; |
| 1659 | UDate date_2 = ref.parse(ctou(datestr_2), ec); |
| 1660 | if (!assertSuccess("parse", ec)) return; |
| 1661 | DateInterval dtitv(date, date_2); |
| 1662 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1663 | for ( uint32_t skeletonIndex = 0; |
| 1664 | skeletonIndex < UPRV_LENGTHOF(skeleton); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1665 | ++skeletonIndex ) { |
| 1666 | const UnicodeString& oneSkeleton = skeleton[skeletonIndex]; |
| 1667 | DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(oneSkeleton, loc, ec); |
| 1668 | if (!assertSuccess("createInstance(skeleton)", ec)) return; |
| 1669 | /* |
| 1670 | // reset the calendar to be Gregorian calendar for "th" |
| 1671 | if ( uprv_strcmp(locName, "th") == 0 ) { |
| 1672 | GregorianCalendar* gregCal = new GregorianCalendar(loc, ec); |
| 1673 | if (!assertSuccess("GregorianCalendar()", ec)) return; |
| 1674 | const DateFormat* dformat = dtitvfmt->getDateFormat(); |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 1675 | DateFormat* newOne = dformat->clone(); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1676 | newOne->adoptCalendar(gregCal); |
| 1677 | //dtitvfmt->adoptDateFormat(newOne, ec); |
| 1678 | dtitvfmt->setDateFormat(*newOne, ec); |
| 1679 | delete newOne; |
| 1680 | if (!assertSuccess("adoptDateFormat()", ec)) return; |
| 1681 | } |
| 1682 | */ |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1683 | FieldPosition pos(FieldPosition::DONT_CARE); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1684 | dtitvfmt->format(&dtitv, str.remove(), pos, ec); |
| 1685 | if (!assertSuccess("format", ec)) return; |
| 1686 | #ifdef DTIFMTTS_DEBUG |
| 1687 | oneSkeleton.extract(0, oneSkeleton.length(), result, "UTF-8"); |
| 1688 | sprintf(mesg, "interval by skeleton: %s\n", result); |
| 1689 | PRINTMESG(mesg) |
| 1690 | str.extract(0, str.length(), result, "UTF-8"); |
| 1691 | sprintf(mesg, "interval date: %s\n", result); |
| 1692 | PRINTMESG(mesg) |
| 1693 | #endif |
| 1694 | delete dtitvfmt; |
| 1695 | } |
| 1696 | |
| 1697 | // test user created DateIntervalInfo |
| 1698 | ec = U_ZERO_ERROR; |
| 1699 | DateIntervalInfo* dtitvinf = new DateIntervalInfo(ec); |
| 1700 | dtitvinf->setFallbackIntervalPattern("{0} --- {1}", ec); |
| 1701 | dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_MONTH, "yyyy MMM d - MMM y",ec); |
| 1702 | if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return; |
| 1703 | dtitvinf->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY, UCAL_HOUR_OF_DAY, "yyyy MMM d HH:mm - HH:mm", ec); |
| 1704 | if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec)) return; |
| 1705 | DateIntervalFormat* dtitvfmt = DateIntervalFormat::createInstance(UDAT_YEAR_ABBR_MONTH_DAY, loc, *dtitvinf, ec); |
| 1706 | delete dtitvinf; |
| 1707 | if (!assertSuccess("createInstance(skeleton,dtitvinf)", ec)) return; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1708 | FieldPosition pos(FieldPosition::DONT_CARE); |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1709 | dtitvfmt->format(&dtitv, str.remove(), pos, ec); |
| 1710 | if ( uprv_strcmp(locName, "th") ) { |
| 1711 | if (!assertSuccess("format", ec)) return; |
| 1712 | #ifdef DTIFMTTS_DEBUG |
| 1713 | PRINTMESG("interval format using user defined DateIntervalInfo\n"); |
| 1714 | str.extract(0, str.length(), result, "UTF-8"); |
| 1715 | sprintf(mesg, "interval date: %s\n", result); |
| 1716 | PRINTMESG(mesg) |
| 1717 | #endif |
| 1718 | } else { |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1719 | // for "th", the default calendar is Budhist, |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 1720 | // not Gregorian. |
| 1721 | assertTrue("Default calendar for \"th\" is Budhist", ec == U_ILLEGAL_ARGUMENT_ERROR); |
| 1722 | ec = U_ZERO_ERROR; |
| 1723 | } |
| 1724 | delete dtitvfmt; |
| 1725 | } |
| 1726 | } |
| 1727 | |
Fredrik Roubert | 1b7d32f | 2015-03-19 11:15:44 +0100 | [diff] [blame] | 1728 | void DateIntervalFormatTest::testTicket11583_2() { |
| 1729 | UErrorCode status = U_ZERO_ERROR; |
| 1730 | LocalPointer<DateIntervalFormat> fmt( |
| 1731 | DateIntervalFormat::createInstance("yMMM", "es-US", status)); |
| 1732 | if (!assertSuccess("Error create format object", status)) { |
| 1733 | return; |
| 1734 | } |
| 1735 | DateInterval interval((UDate) 1232364615000.0, (UDate) 1328787015000.0); |
| 1736 | UnicodeString appendTo; |
| 1737 | FieldPosition fpos(FieldPosition::DONT_CARE); |
| 1738 | UnicodeString expected("ene. de 2009 \\u2013 feb. de 2012"); |
| 1739 | assertEquals( |
| 1740 | "", |
| 1741 | expected.unescape(), |
| 1742 | fmt->format(&interval, appendTo, fpos, status)); |
| 1743 | if (!assertSuccess("Error formatting", status)) { |
| 1744 | return; |
| 1745 | } |
| 1746 | } |
| 1747 | |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1748 | |
| 1749 | void DateIntervalFormatTest::testTicket11985() { |
| 1750 | UErrorCode status = U_ZERO_ERROR; |
| 1751 | LocalPointer<DateIntervalFormat> fmt( |
| 1752 | DateIntervalFormat::createInstance(UDAT_HOUR_MINUTE, Locale::getEnglish(), status)); |
| 1753 | if (!assertSuccess("createInstance", status)) { |
| 1754 | return; |
| 1755 | } |
| 1756 | UnicodeString pattern; |
| 1757 | static_cast<const SimpleDateFormat*>(fmt->getDateFormat())->toPattern(pattern); |
| 1758 | assertEquals("Format pattern", "h:mm a", pattern); |
| 1759 | } |
| 1760 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1761 | // Ticket 11669 - thread safety of DateIntervalFormat::format(). This test failed before |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1762 | // the implementation was fixed. |
| 1763 | |
| 1764 | static const DateIntervalFormat *gIntervalFormatter = NULL; // The Formatter to be used concurrently by test threads. |
| 1765 | static const DateInterval *gInterval = NULL; // The date interval to be formatted concurrently. |
| 1766 | static const UnicodeString *gExpectedResult = NULL; |
| 1767 | |
| 1768 | void DateIntervalFormatTest::threadFunc11669(int32_t threadNum) { |
| 1769 | (void)threadNum; |
| 1770 | for (int loop=0; loop<1000; ++loop) { |
| 1771 | UErrorCode status = U_ZERO_ERROR; |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1772 | FieldPosition pos(FieldPosition::DONT_CARE); |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1773 | UnicodeString result; |
| 1774 | gIntervalFormatter->format(gInterval, result, pos, status); |
| 1775 | if (U_FAILURE(status)) { |
| 1776 | errln("%s:%d %s", __FILE__, __LINE__, u_errorName(status)); |
| 1777 | return; |
| 1778 | } |
| 1779 | if (result != *gExpectedResult) { |
| 1780 | errln("%s:%d Expected \"%s\", got \"%s\"", __FILE__, __LINE__, CStr(*gExpectedResult)(), CStr(result)()); |
| 1781 | return; |
| 1782 | } |
| 1783 | } |
| 1784 | } |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1785 | |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1786 | void DateIntervalFormatTest::testTicket11669() { |
| 1787 | UErrorCode status = U_ZERO_ERROR; |
| 1788 | LocalPointer<DateIntervalFormat> formatter(DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, Locale::getEnglish(), status), status); |
| 1789 | LocalPointer<TimeZone> tz(TimeZone::createTimeZone("America/Los_Angleles"), status); |
| 1790 | LocalPointer<Calendar> intervalStart(Calendar::createInstance(*tz, Locale::getEnglish(), status), status); |
| 1791 | LocalPointer<Calendar> intervalEnd(Calendar::createInstance(*tz, Locale::getEnglish(), status), status); |
| 1792 | if (U_FAILURE(status)) { |
| 1793 | errcheckln(status, "%s:%d %s", __FILE__, __LINE__, u_errorName(status)); |
| 1794 | return; |
| 1795 | } |
| 1796 | |
| 1797 | intervalStart->set(2009, 6, 1, 14, 0); |
| 1798 | intervalEnd->set(2009, 6, 2, 14, 0); |
| 1799 | DateInterval interval(intervalStart->getTime(status), intervalEnd->getTime(status)); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1800 | FieldPosition pos(FieldPosition::DONT_CARE); |
Fredrik Roubert | 8de051c | 2016-03-10 13:13:27 +0100 | [diff] [blame] | 1801 | UnicodeString expectedResult; |
| 1802 | formatter->format(&interval, expectedResult, pos, status); |
| 1803 | if (U_FAILURE(status)) { |
| 1804 | errln("%s:%d %s", __FILE__, __LINE__, u_errorName(status)); |
| 1805 | return; |
| 1806 | } |
| 1807 | |
| 1808 | gInterval = &interval; |
| 1809 | gIntervalFormatter = formatter.getAlias(); |
| 1810 | gExpectedResult = &expectedResult; |
| 1811 | |
| 1812 | ThreadPool<DateIntervalFormatTest> threads(this, 4, &DateIntervalFormatTest::threadFunc11669); |
| 1813 | threads.start(); |
| 1814 | threads.join(); |
| 1815 | |
| 1816 | gInterval = NULL; // Don't leave dangling pointers lying around. Not strictly necessary. |
| 1817 | gIntervalFormatter = NULL; |
| 1818 | gExpectedResult = NULL; |
| 1819 | } |
| 1820 | |
| 1821 | |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1822 | // testTicket12065 |
| 1823 | // Using a DateIntervalFormat to format shouldn't change its state in any way |
| 1824 | // that changes how the behavior of operator ==. |
| 1825 | void DateIntervalFormatTest::testTicket12065() { |
| 1826 | UErrorCode status = U_ZERO_ERROR; |
| 1827 | LocalPointer<DateIntervalFormat> formatter(DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY, Locale::getEnglish(), status), status); |
Fredrik Roubert | 0596fae | 2017-04-18 21:34:02 +0200 | [diff] [blame] | 1828 | if (formatter.isNull()) { |
| 1829 | dataerrln("FAIL: DateIntervalFormat::createInstance failed for Locale::getEnglish()"); |
| 1830 | return; |
| 1831 | } |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 1832 | LocalPointer<DateIntervalFormat> clone(formatter->clone()); |
Fredrik Roubert | 64339d3 | 2016-10-21 19:43:16 +0200 | [diff] [blame] | 1833 | if (*formatter != *clone) { |
| 1834 | errln("%s:%d DateIntervalFormat and clone are not equal.", __FILE__, __LINE__); |
| 1835 | return; |
| 1836 | } |
| 1837 | DateInterval interval((UDate) 1232364615000.0, (UDate) 1328787015000.0); |
| 1838 | UnicodeString appendTo; |
| 1839 | FieldPosition fpos(FieldPosition::DONT_CARE); |
| 1840 | formatter->format(&interval, appendTo, fpos, status); |
| 1841 | if (*formatter != *clone) { |
| 1842 | errln("%s:%d DateIntervalFormat and clone are not equal after formatting.", __FILE__, __LINE__); |
| 1843 | return; |
| 1844 | } |
| 1845 | if (U_FAILURE(status)) { |
| 1846 | errln("%s:%d %s", __FILE__, __LINE__, u_errorName(status)); |
| 1847 | } |
| 1848 | } |
| 1849 | |
| 1850 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1851 | void DateIntervalFormatTest::testFormattedDateInterval() { |
| 1852 | IcuTestErrorCode status(*this, "testFormattedDateInterval"); |
| 1853 | LocalPointer<DateIntervalFormat> fmt(DateIntervalFormat::createInstance(u"dMMMMy", "en-US", status), status); |
| 1854 | |
| 1855 | { |
| 1856 | const char16_t* message = u"FormattedDateInterval test 1"; |
| 1857 | const char16_t* expectedString = u"July 20 \u2013 25, 2018"; |
| 1858 | LocalPointer<Calendar> input1(Calendar::createInstance("en-GB", status)); |
| 1859 | if (status.errIfFailureAndReset()) { return; } |
| 1860 | LocalPointer<Calendar> input2(Calendar::createInstance("en-GB", status)); |
| 1861 | if (status.errIfFailureAndReset()) { return; } |
| 1862 | input1->set(2018, 6, 20); |
| 1863 | input2->set(2018, 6, 25); |
| 1864 | FormattedDateInterval result = fmt->formatToValue(*input1, *input2, status); |
| 1865 | static const UFieldPositionWithCategory expectedFieldPositions[] = { |
| 1866 | // field, begin index, end index |
| 1867 | {UFIELD_CATEGORY_DATE, UDAT_MONTH_FIELD, 0, 4}, |
| 1868 | {UFIELD_CATEGORY_DATE_INTERVAL_SPAN, 0, 5, 7}, |
| 1869 | {UFIELD_CATEGORY_DATE, UDAT_DATE_FIELD, 5, 7}, |
| 1870 | {UFIELD_CATEGORY_DATE_INTERVAL_SPAN, 1, 10, 12}, |
| 1871 | {UFIELD_CATEGORY_DATE, UDAT_DATE_FIELD, 10, 12}, |
| 1872 | {UFIELD_CATEGORY_DATE, UDAT_YEAR_FIELD, 14, 18}}; |
| 1873 | checkMixedFormattedValue( |
| 1874 | message, |
| 1875 | result, |
| 1876 | expectedString, |
| 1877 | expectedFieldPositions, |
| 1878 | UPRV_LENGTHOF(expectedFieldPositions)); |
| 1879 | } |
| 1880 | |
Nikita Iashchenko | 4c0e286 | 2019-11-05 16:38:00 +0000 | [diff] [blame] | 1881 | { |
| 1882 | const char16_t* message = u"FormattedDateInterval identical dates test: no span field"; |
| 1883 | const char16_t* expectedString = u"July 20, 2018"; |
| 1884 | LocalPointer<Calendar> input1(Calendar::createInstance("en-GB", status)); |
| 1885 | input1->set(2018, 6, 20); |
| 1886 | FormattedDateInterval result = fmt->formatToValue(*input1, *input1, status); |
| 1887 | static const UFieldPositionWithCategory expectedFieldPositions[] = { |
| 1888 | // field, begin index, end index |
| 1889 | {UFIELD_CATEGORY_DATE, UDAT_MONTH_FIELD, 0, 4}, |
| 1890 | {UFIELD_CATEGORY_DATE, UDAT_DATE_FIELD, 5, 7}, |
| 1891 | {UFIELD_CATEGORY_DATE, UDAT_YEAR_FIELD, 9, 13}}; |
| 1892 | checkMixedFormattedValue( |
| 1893 | message, |
| 1894 | result, |
| 1895 | expectedString, |
| 1896 | expectedFieldPositions, |
| 1897 | UPRV_LENGTHOF(expectedFieldPositions)); |
| 1898 | } |
| 1899 | |
| 1900 | // Test sample code |
| 1901 | { |
| 1902 | LocalPointer<Calendar> input1(Calendar::createInstance("en-GB", status)); |
| 1903 | LocalPointer<Calendar> input2(Calendar::createInstance("en-GB", status)); |
| 1904 | input1->set(2018, 6, 20); |
| 1905 | input2->set(2018, 7, 3); |
| 1906 | |
| 1907 | // Let fmt be a DateIntervalFormat for locale en-US and skeleton dMMMMy |
| 1908 | // Let input1 be July 20, 2018 and input2 be August 3, 2018: |
| 1909 | FormattedDateInterval result = fmt->formatToValue(*input1, *input2, status); |
| 1910 | assertEquals("Expected output from format", |
| 1911 | u"July 20 \u2013 August 3, 2018", result.toString(status)); |
| 1912 | ConstrainedFieldPosition cfpos; |
| 1913 | cfpos.constrainField(UFIELD_CATEGORY_DATE_INTERVAL_SPAN, 0); |
| 1914 | if (result.nextPosition(cfpos, status)) { |
| 1915 | assertEquals("Expect start index", 0, cfpos.getStart()); |
| 1916 | assertEquals("Expect end index", 7, cfpos.getLimit()); |
| 1917 | } else { |
| 1918 | // No such span: can happen if input dates are equal. |
| 1919 | } |
| 1920 | assertFalse("No more than one occurrence of the field", |
| 1921 | result.nextPosition(cfpos, status)); |
| 1922 | } |
| 1923 | |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1924 | // To test the fallback pattern behavior, make a custom DateIntervalInfo. |
| 1925 | DateIntervalInfo dtitvinf(status); |
| 1926 | dtitvinf.setFallbackIntervalPattern("<< {1} --- {0} >>", status); |
| 1927 | fmt.adoptInsteadAndCheckErrorCode( |
| 1928 | DateIntervalFormat::createInstance(u"dMMMMy", "en-US", dtitvinf, status), |
| 1929 | status); |
| 1930 | |
| 1931 | { |
| 1932 | const char16_t* message = u"FormattedDateInterval with fallback format test 1"; |
| 1933 | const char16_t* expectedString = u"<< July 25, 2018 --- July 20, 2018 >>"; |
| 1934 | LocalPointer<Calendar> input1(Calendar::createInstance("en-GB", status)); |
| 1935 | if (status.errIfFailureAndReset()) { return; } |
| 1936 | LocalPointer<Calendar> input2(Calendar::createInstance("en-GB", status)); |
| 1937 | if (status.errIfFailureAndReset()) { return; } |
| 1938 | input1->set(2018, 6, 20); |
| 1939 | input2->set(2018, 6, 25); |
| 1940 | FormattedDateInterval result = fmt->formatToValue(*input1, *input2, status); |
| 1941 | static const UFieldPositionWithCategory expectedFieldPositions[] = { |
| 1942 | // field, begin index, end index |
| 1943 | {UFIELD_CATEGORY_DATE_INTERVAL_SPAN, 1, 3, 16}, |
| 1944 | {UFIELD_CATEGORY_DATE, UDAT_MONTH_FIELD, 3, 7}, |
| 1945 | {UFIELD_CATEGORY_DATE, UDAT_DATE_FIELD, 8, 10}, |
| 1946 | {UFIELD_CATEGORY_DATE, UDAT_YEAR_FIELD, 12, 16}, |
| 1947 | {UFIELD_CATEGORY_DATE_INTERVAL_SPAN, 0, 21, 34}, |
| 1948 | {UFIELD_CATEGORY_DATE, UDAT_MONTH_FIELD, 21, 25}, |
| 1949 | {UFIELD_CATEGORY_DATE, UDAT_DATE_FIELD, 26, 28}, |
| 1950 | {UFIELD_CATEGORY_DATE, UDAT_YEAR_FIELD, 30, 34}}; |
| 1951 | checkMixedFormattedValue( |
| 1952 | message, |
| 1953 | result, |
| 1954 | expectedString, |
| 1955 | expectedFieldPositions, |
| 1956 | UPRV_LENGTHOF(expectedFieldPositions)); |
| 1957 | } |
| 1958 | } |
| 1959 | |
Nikita Iashchenko | ebc670d | 2020-01-02 14:35:08 +0000 | [diff] [blame] | 1960 | void DateIntervalFormatTest::testCreateInstanceForAllLocales() { |
| 1961 | IcuTestErrorCode status(*this, "testCreateInstanceForAllLocales"); |
| 1962 | int32_t locale_count = 0; |
| 1963 | const Locale* locales = icu::Locale::getAvailableLocales(locale_count); |
| 1964 | // Iterate through all locales |
| 1965 | for (int32_t i = 0; i < locale_count; i++) { |
| 1966 | std::unique_ptr<icu::StringEnumeration> calendars( |
| 1967 | icu::Calendar::getKeywordValuesForLocale( |
| 1968 | "calendar", locales[i], FALSE, status)); |
| 1969 | int32_t calendar_count = calendars->count(status); |
| 1970 | if (status.errIfFailureAndReset()) { break; } |
| 1971 | // In quick mode, only run 1/5 of locale combination |
| 1972 | // to make the test run faster. |
| 1973 | if (quick && (i % 5 != 0)) continue; |
| 1974 | LocalPointer<DateIntervalFormat> fmt( |
| 1975 | DateIntervalFormat::createInstance(u"dMMMMy", locales[i], status), |
| 1976 | status); |
| 1977 | if (status.errIfFailureAndReset(locales[i].getName())) { |
| 1978 | continue; |
| 1979 | } |
| 1980 | // Iterate through all calendars in this locale |
| 1981 | for (int32_t j = 0; j < calendar_count; j++) { |
| 1982 | // In quick mode, only run 1/7 of locale/calendar combination |
| 1983 | // to make the test run faster. |
| 1984 | if (quick && ((i * j) % 7 != 0)) continue; |
| 1985 | const char* calendar = calendars->next(nullptr, status); |
| 1986 | Locale locale(locales[i]); |
| 1987 | locale.setKeywordValue("calendar", calendar, status); |
| 1988 | fmt.adoptInsteadAndCheckErrorCode( |
| 1989 | DateIntervalFormat::createInstance(u"dMMMMy", locale, status), |
| 1990 | status); |
| 1991 | status.errIfFailureAndReset(locales[i].getName()); |
| 1992 | } |
| 1993 | } |
| 1994 | } |
Nikita Iashchenko | da0990f | 2019-06-13 19:36:45 +0100 | [diff] [blame] | 1995 | |
Victor Chang | 8249390 | 2020-12-23 17:27:56 +0000 | [diff] [blame] | 1996 | void DateIntervalFormatTest::testFormatMillisecond() { |
| 1997 | struct |
| 1998 | { |
| 1999 | int year; |
| 2000 | int month; |
| 2001 | int day; |
| 2002 | int from_hour; |
| 2003 | int from_miniute; |
| 2004 | int from_second; |
| 2005 | int from_millisecond; |
| 2006 | int to_hour; |
| 2007 | int to_miniute; |
| 2008 | int to_second; |
| 2009 | int to_millisecond; |
| 2010 | const char* skeleton; |
| 2011 | const char16_t* expected; |
| 2012 | } |
| 2013 | kTestCases [] = |
| 2014 | { |
| 2015 | // From To |
| 2016 | // y m d h m s ms h m s ms skeleton expected |
| 2017 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "ms", u"23:45"}, |
| 2018 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "msS", u"23:45.3"}, |
| 2019 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "msSS", u"23:45.32"}, |
| 2020 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "msSSS", u"23:45.321"}, |
| 2021 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "ms", u"23:45"}, |
| 2022 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "msS", u"23:45.3 \u2013 23:45.9"}, |
| 2023 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "msSS", u"23:45.32 \u2013 23:45.98"}, |
| 2024 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "msSSS", u"23:45.321 \u2013 23:45.987"}, |
| 2025 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "ms", u"23:45 \u2013 23:46"}, |
| 2026 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "msS", u"23:45.3 \u2013 23:46.9"}, |
| 2027 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "msSS", u"23:45.32 \u2013 23:46.98"}, |
| 2028 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "msSSS", u"23:45.321 \u2013 23:46.987"}, |
| 2029 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "ms", u"23:45 \u2013 24:45"}, |
| 2030 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "msS", u"23:45.3 \u2013 24:45.9"}, |
| 2031 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "msSS", u"23:45.32 \u2013 24:45.98"}, |
| 2032 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "msSSS", u"23:45.321 \u2013 24:45.987"}, |
| 2033 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "s", u"45"}, |
| 2034 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "sS", u"45.3"}, |
| 2035 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "sSS", u"45.32"}, |
| 2036 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "sSSS", u"45.321"}, |
| 2037 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "s", u"45"}, |
| 2038 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "sS", u"45.3 \u2013 45.9"}, |
| 2039 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "sSS", u"45.32 \u2013 45.98"}, |
| 2040 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "sSSS", u"45.321 \u2013 45.987"}, |
| 2041 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "s", u"45 \u2013 46"}, |
| 2042 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "sS", u"45.3 \u2013 46.9"}, |
| 2043 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "sSS", u"45.32 \u2013 46.98"}, |
| 2044 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "sSSS", u"45.321 \u2013 46.987"}, |
| 2045 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "s", u"45 \u2013 45"}, |
| 2046 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "sS", u"45.3 \u2013 45.9"}, |
| 2047 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "sSS", u"45.32 \u2013 45.98"}, |
| 2048 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "sSSS", u"45.321 \u2013 45.987"}, |
| 2049 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "S", u"3"}, |
| 2050 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "SS", u"32"}, |
| 2051 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 321, "SSS", u"321"}, |
| 2052 | |
| 2053 | // Same millisecond but in different second. |
| 2054 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 321, "S", u"3 \u2013 3"}, |
| 2055 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 321, "SS", u"32 \u2013 32"}, |
| 2056 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 321, "SSS", u"321 \u2013 321"}, |
| 2057 | |
| 2058 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "S", u"3 \u2013 9"}, |
| 2059 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "SS", u"32 \u2013 98"}, |
| 2060 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 45, 987, "SSS", u"321 \u2013 987"}, |
| 2061 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "S", u"3 \u2013 9"}, |
| 2062 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "SS", u"32 \u2013 98"}, |
| 2063 | { 2019, 2, 10, 1, 23, 45, 321, 1, 23, 46, 987, "SSS", u"321 \u2013 987"}, |
| 2064 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "S", u"3 \u2013 9"}, |
| 2065 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "SS", u"32 \u2013 98"}, |
| 2066 | { 2019, 2, 10, 1, 23, 45, 321, 2, 24, 45, 987, "SSS", u"321 \u2013 987"}, |
| 2067 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, nullptr, nullptr}, |
| 2068 | }; |
| 2069 | |
| 2070 | const Locale &enLocale = Locale::getEnglish(); |
| 2071 | IcuTestErrorCode status(*this, "testFormatMillisecond"); |
| 2072 | LocalPointer<Calendar> calendar(Calendar::createInstance(enLocale, status)); |
| 2073 | if (status.errIfFailureAndReset()) { return; } |
| 2074 | |
| 2075 | for (int32_t i = 0; kTestCases[i].year > 0; i++) { |
| 2076 | LocalPointer<DateIntervalFormat> fmt(DateIntervalFormat::createInstance( |
| 2077 | kTestCases[i].skeleton, enLocale, status)); |
| 2078 | if (status.errIfFailureAndReset()) { continue; } |
| 2079 | |
| 2080 | calendar->clear(); |
| 2081 | calendar->set(kTestCases[i].year, kTestCases[i].month, kTestCases[i].day, |
| 2082 | kTestCases[i].from_hour, kTestCases[i].from_miniute, kTestCases[i].from_second); |
| 2083 | UDate from = calendar->getTime(status) + kTestCases[i].from_millisecond; |
| 2084 | if (status.errIfFailureAndReset()) { continue; } |
| 2085 | |
| 2086 | calendar->clear(); |
| 2087 | calendar->set(kTestCases[i].year, kTestCases[i].month, kTestCases[i].day, |
| 2088 | kTestCases[i].to_hour, kTestCases[i].to_miniute, kTestCases[i].to_second); |
| 2089 | UDate to = calendar->getTime(status) + kTestCases[i].to_millisecond; |
| 2090 | FormattedDateInterval res = fmt->formatToValue(DateInterval(from, to), status); |
| 2091 | if (status.errIfFailureAndReset()) { continue; } |
| 2092 | |
| 2093 | UnicodeString formatted = res.toString(status); |
| 2094 | if (status.errIfFailureAndReset()) { continue; } |
| 2095 | if (formatted != kTestCases[i].expected) { |
| 2096 | std::string tmp1; |
| 2097 | std::string tmp2; |
| 2098 | errln("Case %d for skeleton %s : Got %s but expect %s", |
| 2099 | i, kTestCases[i].skeleton, formatted.toUTF8String<std::string>(tmp1).c_str(), |
| 2100 | UnicodeString(kTestCases[i].expected).toUTF8String<std::string>(tmp2).c_str()); |
| 2101 | } |
| 2102 | } |
| 2103 | } |
| 2104 | |
| 2105 | void DateIntervalFormatTest::testTicket20707() { |
| 2106 | IcuTestErrorCode status(*this, "testTicket20707"); |
| 2107 | |
| 2108 | const char16_t timeZone[] = u"UTC"; |
| 2109 | Locale locales[] = {"en-u-hc-h24", "en-u-hc-h23", "en-u-hc-h12", "en-u-hc-h11", "en", "en-u-hc-h25", "hi-IN-u-hc-h11"}; |
| 2110 | |
| 2111 | // Clomuns: hh, HH, kk, KK, jj, JJs, CC |
| 2112 | UnicodeString expected[][7] = { |
| 2113 | // Hour-cycle: k |
| 2114 | {u"12 AM", u"24", u"24", u"12 AM", u"24", u"0 (hour: 24)", u"12 AM"}, |
| 2115 | // Hour-cycle: H |
| 2116 | {u"12 AM", u"00", u"00", u"12 AM", u"00", u"0 (hour: 00)", u"12 AM"}, |
| 2117 | // Hour-cycle: h |
| 2118 | {u"12 AM", u"00", u"00", u"12 AM", u"12 AM", u"0 (hour: 12)", u"12 AM"}, |
| 2119 | // Hour-cycle: K |
| 2120 | {u"0 AM", u"00", u"00", u"0 AM", u"0 AM", u"0 (hour: 00)", u"0 AM"}, |
| 2121 | {u"12 AM", u"00", u"00", u"12 AM", u"12 AM", u"0 (hour: 12)", u"12 AM"}, |
| 2122 | {u"12 AM", u"00", u"00", u"12 AM", u"12 AM", u"0 (hour: 12)", u"12 AM"}, |
| 2123 | // Hour-cycle: K |
| 2124 | {u"0 am", u"00", u"00", u"0 am", u"0 am", u"0 (\u0918\u0902\u091F\u093E: 00)", u"\u0930\u093E\u0924 0"} |
| 2125 | }; |
| 2126 | |
| 2127 | int32_t i = 0; |
| 2128 | for (Locale locale : locales) { |
| 2129 | int32_t j = 0; |
| 2130 | for (const UnicodeString skeleton : {u"hh", u"HH", u"kk", u"KK", u"jj", u"JJs", u"CC"}) { |
| 2131 | LocalPointer<DateIntervalFormat> dtifmt(DateIntervalFormat::createInstance(skeleton, locale, status)); |
| 2132 | if (status.errDataIfFailureAndReset()) { |
| 2133 | continue; |
| 2134 | } |
| 2135 | FieldPosition fposition; |
| 2136 | UnicodeString result; |
| 2137 | LocalPointer<Calendar> calendar(Calendar::createInstance(TimeZone::createTimeZone(timeZone), status)); |
| 2138 | calendar->setTime(UDate(1563235200000), status); |
| 2139 | dtifmt->format(*calendar, *calendar, result, fposition, status); |
| 2140 | |
| 2141 | assertEquals("Formatted result", expected[i][j++], result); |
| 2142 | } |
| 2143 | i++; |
| 2144 | } |
| 2145 | } |
| 2146 | |
Jean-Baptiste Queru | c69afce | 2009-07-20 15:02:39 -0700 | [diff] [blame] | 2147 | #endif /* #if !UCONFIG_NO_FORMATTING */ |