/* * return as W1334()2013/08/20 * 1. if sunday==> week = week+1 * getWeekOfYear(Ext use ISO-8601,week begin monday) * js Date(week begin sunday) * 2. if week > 52==> year = year +1; week = week - 52; * 3. if month ==11(12 month) and week <2 ==> year = year +1; */ function getWeekStrOfDate(date) { var weekStr = null; if(date!=null) { weekStr = "W"; var dateYear = date.getFullYear(); var dateWeek = Ext.Date.getWeekOfYear(date); var firstDayOfMonth = Ext.Date.getFirstDayOfMonth(date); var day = date.getDate(); var month = date.getMonth(); //weekday 0-6 var weekday = date.getDay(); if(weekday===0) { dateWeek++; }