Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: third_party/WebKit/Source/platform/DateComponents.cpp

Issue 2418573003: date-time-local WIP
Patch Set: Fix some more Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } 466 }
467 467
468 bool DateComponents::parseDateTimeLocal(const String& src, 468 bool DateComponents::parseDateTimeLocal(const String& src,
469 unsigned start, 469 unsigned start,
470 unsigned& end) { 470 unsigned& end) {
471 unsigned index; 471 unsigned index;
472 if (!parseDate(src, start, index)) 472 if (!parseDate(src, start, index))
473 return false; 473 return false;
474 if (index >= src.length()) 474 if (index >= src.length())
475 return false; 475 return false;
476 if (src[index] != 'T') 476 if (src[index] != 'T' && src[index] != ' ')
477 return false; 477 return false;
478 ++index; 478 ++index;
479 if (!parseTime(src, index, end)) 479 if (!parseTime(src, index, end))
480 return false; 480 return false;
481 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, 481 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute,
482 m_second, m_millisecond)) 482 m_second, m_millisecond))
483 return false; 483 return false;
484 m_type = DateTimeLocal; 484 m_type = DateTimeLocal;
485 return true; 485 return true;
486 } 486 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 case Week: 712 case Week:
713 return String::format("%04d-W%02d", m_year, m_week); 713 return String::format("%04d-W%02d", m_year, m_week);
714 case Invalid: 714 case Invalid:
715 break; 715 break;
716 } 716 }
717 ASSERT_NOT_REACHED(); 717 ASSERT_NOT_REACHED();
718 return String("(Invalid DateComponents)"); 718 return String("(Invalid DateComponents)");
719 } 719 }
720 720
721 } // namespace blink 721 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698