我已经找到了答案,但似乎找不到答案.有人可以解释为什么以下代码不会给我每个月1,但跳到31几个月?报告事件需要确定下个月的日期.
DateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
Calendar cal = Calendar.getInstance( TimeZone
.getTimeZone( "America/Los_Angeles" ) );
DateFormat formatter = new SimpleDateFormat("dd-MMM-yy");
Date date;
try
{
date = (Date)formatter.parse("01-JUN-12");
cal.setTime(date);
//cal.set(2012, 05, 01);
long now = new Date().getTime();
int frequency = 1;
System.out.println("Current calendar time=" + cal.getTime().toString()) ;
while (cal.getTime().getTime() < now)
{
cal.add( Calendar.MONTH, frequency );
System.out.println("In loop - current calendar time=" + cal.getTime().toString()) ;
}
}
catch (ParseException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
输出是:
Current calendar …Run Code Online (Sandbox Code Playgroud) 在YUIDoc中,我想评论作为参数传递的对象文字.请参阅以下代码段:
@param {Array} colDefs Array of object literal column definitions for the grid<ul>
<li>title - Column header display</li>
<li>key - The key of the column from the JSON data array</li>
<li>type - The data type of the column. </li></ul>
Run Code Online (Sandbox Code Playgroud)
我将哪些标签添加到列表项中,以便指定属性类型(String,Object等)?如果我添加{String}它只显示为文本,而不是我用@param标签获得的漂亮格式.
也许这甚至不可能?