HTMLInputElement::valueAsDate setter support for type=week.
Created attachment 47173 [details] Proposd patch
This is the last patch for HTMLInputElement::valueAsDate!
Attachment 47173 [details] did not build on mac: Build output: http://webkit-commit-queue.appspot.com/results/203576
Created attachment 47174 [details] Proposed patch (rev.2)
Comment on attachment 47174 [details] Proposed patch (rev.2) > +debug('Around Geregorian calendar starting year:'); Typo: "Geregorian". > +// Gregorian calendar started in 1582. We don't suuprot that year. Typo: "suuprot". > case Week: { > - // Offset from January 1st to Monday of the ISO 8601's first week. > - // ex. If January 1st is Friday, such Monday is 3 days later. > - int offsetTo1stWeekStart = 1 - dayOfWeek(m_year, 0, 1); > - if (offsetTo1stWeekStart <= -4) > - offsetTo1stWeekStart += 7; > - return (dateToDaysFrom1970(m_year, 0, 1) + offsetTo1stWeekStart + (m_week - 1) * 7) * msPerDay; > + return (dateToDaysFrom1970(m_year, 0, 1) + offsetTo1stWeekStart(m_year) + (m_week - 1) * 7) * msPerDay; > } Should get rid of the unneeded braces here.
Thank you for the review. (In reply to comment #5) > (From update of attachment 47174 [details]) > > +debug('Around Geregorian calendar starting year:'); > > Typo: "Geregorian". Fixed. > > +// Gregorian calendar started in 1582. We don't suuprot that year. > > Typo: "suuprot". Fixed. > > case Week: { > > - // Offset from January 1st to Monday of the ISO 8601's first week. > > - // ex. If January 1st is Friday, such Monday is 3 days later. > > - int offsetTo1stWeekStart = 1 - dayOfWeek(m_year, 0, 1); > > - if (offsetTo1stWeekStart <= -4) > > - offsetTo1stWeekStart += 7; > > - return (dateToDaysFrom1970(m_year, 0, 1) + offsetTo1stWeekStart + (m_week - 1) * 7) * msPerDay; > > + return (dateToDaysFrom1970(m_year, 0, 1) + offsetTo1stWeekStart(m_year) + (m_week - 1) * 7) * msPerDay; > > } > > Should get rid of the unneeded braces here. Fixed. Landed as r53787.