(
CharSequence text,
ParsePosition pp
)
| 238 | } |
| 239 | |
| 240 | static Meridiem parseAmPm( |
| 241 | CharSequence text, |
| 242 | ParsePosition pp |
| 243 | ) { |
| 244 | |
| 245 | int offset = pp.getIndex(); |
| 246 | |
| 247 | if (text.length() >= offset + 2) { |
| 248 | char c2 = text.charAt(offset + 1); |
| 249 | if (c2 == 'M' || c2 == 'm') { |
| 250 | char c1 = text.charAt(offset); |
| 251 | if (c1 == 'A' || c1 == 'a') { |
| 252 | pp.setIndex(offset + 2); |
| 253 | return Meridiem.AM; |
| 254 | } else if (c1 == 'P' || c1 == 'p') { |
| 255 | pp.setIndex(offset + 2); |
| 256 | return Meridiem.PM; |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | return null; |
| 262 | |
| 263 | } |
| 264 | |
| 265 | } |