library/src/main/java/com/alamkanak/weekview/WeekView.java
/**
     * Show a specific day on the week view.
     *
     * @param date The date to show.
     */
Show a specific day on the week view.
@param date The date to show.
Show a specific day on the week view . @param date The date to show .
public void goToDate(Calendar date) {
        mScroller.forceFinished(true);
        mCurrentScrollDirection = mCurrentFlingDirection = Direction.NONE;
        date.set(Calendar.HOUR_OF_DAY, 0);
        date.set(Calendar.MINUTE, 0);
        date.set(Calendar.SECOND, 0);
        date.set(Calendar.MILLISECOND, 0);
        if (mAreDimensionsInvalid) {
            mScrollToDay = date;
            return;
        }
        mRefreshEvents = true;
        Calendar today = Calendar.getInstance();
        today.set(Calendar.HOUR_OF_DAY, 0);
        today.set(Calendar.MINUTE, 0);
        today.set(Calendar.SECOND, 0);
        today.set(Calendar.MILLISECOND, 0);
        long day = 1000L * 60L * 60L * 24L;
        long dateInMillis = date.getTimeInMillis() + date.getTimeZone().getOffset(date.getTimeInMillis());
        long todayInMillis = today.getTimeInMillis() + today.getTimeZone().getOffset(today.getTimeInMillis());
        long dateDifference = (dateInMillis / day) - (todayInMillis / day);
        mCurrentOrigin.x = -dateDifference * mWidthPerDay;
        invalidate();
    }
public void goToDate ( Calendar date ) { mScroller . forceFinished ( true ) ; mCurrentScrollDirection = mCurrentFlingDirection = Direction . NONE ; date . set ( Calendar . HOUR_OF_DAY , 0 ) ; date . set ( Calendar . MINUTE , 0 ) ; date . set ( Calendar . SECOND , 0 ) ; date . set ( Calendar . MILLISECOND , 0 ) ; if ( mAreDimensionsInvalid ) { mScrollToDay = date ; return ; } mRefreshEvents = true ; Calendar today = Calendar . getInstance ( ) ; today . set ( Calendar . HOUR_OF_DAY , 0 ) ; today . set ( Calendar . MINUTE , 0 ) ; today . set ( Calendar . SECOND , 0 ) ; today . set ( Calendar . MILLISECOND , 0 ) ; long day = 1000L * 60L * 60L * 24L ; long dateInMillis = date . getTimeInMillis ( ) + date . getTimeZone ( ) . getOffset ( date . getTimeInMillis ( ) ) ; long todayInMillis = today . getTimeInMillis ( ) + today . getTimeZone ( ) . getOffset ( today . getTimeInMillis ( ) ) ; long dateDifference = ( dateInMillis / day ) - ( todayInMillis / day ) ; mCurrentOrigin . x = - dateDifference * mWidthPerDay ; invalidate ( ) ; }
Show a specific day on the week view.
Show a specific day on the week view .