1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    61
    Answers
    3
    Vote Rating
    0
    azinyama is on a distinguished road

      0  

    Default Answered: Compare TimeField Value with Time From Date

    Answered: Compare TimeField Value with Time From Date


    Good day all!!!

    I'm have a timefield "TimeField01". I'm trying to get the time from the timefield and compare it with the time from new Date().

    I see in the documentation clearTime which removes the time from the date, but there is no clearDate. I would like to remove the date from the timefield and from new Date() and then compare the two times. How would I go about doing this???

  2. You can set the two dates to the same date, then using getTime() to convert them to miliseconds to compare.
    Code:
    function compareTime(time1, time2){
        time1.setFullYear(1970, 0, 1);
        time2.setFullYear(1970, 0, 1);
        return time1.getTime() - time2.getTime();
    }

  3. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    You can set the two dates to the same date, then using getTime() to convert them to miliseconds to compare.
    Code:
    function compareTime(time1, time2){
        time1.setFullYear(1970, 0, 1);
        time2.setFullYear(1970, 0, 1);
        return time1.getTime() - time2.getTime();
    }

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    61
    Answers
    3
    Vote Rating
    0
    azinyama is on a distinguished road

      0  

    Default


    Thanks a lot... That worked...

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi