<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 0,  comments - 5,  trackbacks - 0
    /** **對時間周的處理?傳入{"2008-05-25","2008-07-5"},返回{2008-6-23,2008-6-29,2008-6-30,2008-7-6}****** */
    ????
    public ? static ?String[]?getBeginAndEndWeek(String?dateBeg,String?dateEnd)
    ????
    {
    ????????String?temp?
    = ? "" ;
    ????????String[]?tempArr?
    = ? null ;
    ????????Date?begin?
    = ?formatDate(dateBeg);
    ????????GregorianCalendar?date1?
    = ? new ?GregorianCalendar();
    ????????date1.setTime(begin);
    ????????
    int ?DAY_OF_WEEK1? = ?date1.get(GregorianCalendar.DAY_OF_WEEK);
    ????????
    if (DAY_OF_WEEK1 == 2 )
    ????????
    {
    ????????}
    else
    ????????
    {
    ????????????
    int ?changeDay? = ?DAY_OF_WEEK1 - 2 ;
    ????????????
    if (changeDay ==- 1 )?changeDay? = ? 6 ;
    ????????????date1.set(GregorianCalendar.DATE,?date1.get(Calendar.DATE)
    - changeDay);
    ????????}

    ????????
    ????????Date?end?
    = ?formatDate(dateEnd);
    ????????GregorianCalendar?date2?
    = ? new ?GregorianCalendar();
    ????????date2.setTime(end);
    ????????
    int ?DAY_OF_WEEK2? = ?date2.get(GregorianCalendar.DAY_OF_WEEK);
    ????????
    if (DAY_OF_WEEK2 == 1 )
    ????????
    {
    ????????}
    else
    ????????
    {
    ????????????
    int ?changeDay? = ? 8 - DAY_OF_WEEK2;
    ????????????date2.set(GregorianCalendar.DATE,?date2.get(Calendar.DATE)
    + changeDay);
    ????????}

    ????????
    ????????GregorianCalendar?date3?
    = ? new ?GregorianCalendar();
    ????????date3.setTime(date1.getTime());
    ????????date3.add(Calendar.DATE,?
    - 1 );
    ????????
    if (date1.compareTo(date2) ==- 1 )
    ????????
    {
    ????????????temp?
    = ?temp? + ?formatDate(date1.getTime())? + " , " ;
    ????????????date1.add(Calendar.DATE,?
    7 );
    ????????????date3.add(Calendar.DATE,?
    7 );
    ????????????
    while (date1.compareTo(date2) ==- 1 )
    ????????????
    {
    ????????????????temp?
    = ?temp? + ?formatDate(date3.getTime()) + " , " + formatDate(date1.getTime())? + " , " ;
    ????????????????date3.add(Calendar.DATE,?
    7 );
    ????????????????date1.add(Calendar.DATE,?
    7 );
    ????????????}

    ????????????temp?
    = ?temp? + ?formatDate(date2.getTime())? + " , " ;
    ????????}
    else
    ????????
    {
    ????????????date2.setTime(date1.getTime());
    ????????????date2.add(Calendar.DATE,?
    6 );
    ????????????temp?
    = ?formatDate(date1.getTime()) + " , " + formatDate(date2.getTime()) + " , " ;
    ????????}

    ????????
    if (temp.length() > 1 )
    ????????
    {
    ????????????tempArr?
    = ?temp.split( " , " );
    ????????????
    for ( int ?i = 0 ;?i < tempArr.length;?i ++ )
    ????????????
    {
    ????????????????System.out.println(tempArr[i]);
    ????????????}

    ????????}

    ????????
    return ?tempArr;
    ????}



    public ? static ?Date?formatDate(String?date)
    ????
    {
    ????????Date?d1?
    = ? new ?Date();
    ????????
    if (date == null ? || ?date.equals( "" ))? return ? new ?Date();
    ????????
    try
    ????????
    {
    ????????????DateFormat?df?
    = ? new ?SimpleDateFormat( " yyyy-MM-dd " );
    ????????????d1?
    = ?df.parse(date);
    ????????}

    ????????
    catch (Exception?ex)
    ????????
    {
    ????????????
    ????????}

    ????????
    return ?d1;
    ????????
    ????}
    posted on 2008-06-25 22:36 crazy 閱讀(91) 評論(0)  編輯  收藏 所屬分類: java
    主站蜘蛛池模板: 1000部拍拍拍18免费网站| 两个人看的www免费| 最近的中文字幕大全免费版| 亚洲午夜视频在线观看| 无人在线观看免费高清| 亚洲av无码一区二区三区网站 | 又粗又硬免费毛片| 国产一区二区三区亚洲综合 | 久久久久国色AV免费看图片| 亚洲制服在线观看| 18禁无遮挡无码网站免费| 亚洲欧美日韩中文字幕一区二区三区| 免费无码AV片在线观看软件| 亚洲成a∧人片在线观看无码| 在线免费观看韩国a视频| 高潮内射免费看片| 在线精品亚洲一区二区三区| 国产午夜精品免费一区二区三区 | 日本免费网站观看| 香蕉97碰碰视频免费| 亚洲色精品aⅴ一区区三区| 久操视频在线免费观看| 亚洲人成电影院在线观看| 成年女性特黄午夜视频免费看| 亚洲国产精品精华液| 亚洲中文久久精品无码ww16| 91久久青青草原线免费| 亚洲私人无码综合久久网| 国产一区二区免费在线| 日韩免费高清播放器| 亚洲一欧洲中文字幕在线| 免费看片免费播放| 九九热久久免费视频| 亚洲日韩在线视频| 免费v片视频在线观看视频| 四虎国产精品永久免费网址| 中国亚洲呦女专区| 亚洲人成无码网WWW| 久久久久高潮毛片免费全部播放| 亚洲AV成人影视在线观看| 亚洲性久久久影院|