Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

how to compare two date in typescript

for(let k = 0; k < this.bookingDetailsArrayRealObject.length; k++){
        let dateCheckOut = this.bookingDetailsArrayRealObject[k].package.chackout;
        let dateToBeCheckOut = new Date(dateCheckOut);
        let today = new Date();
        //let today_test = new Date();
        if(this.bookingDetailsArrayRealObject[k].status){
          if(dateToBeCheckOut < today){
            this.bookingIdsToBeUpdated.push(this.bookingDetailsArrayRealObject[k]._id);
            window.alert('true');
            console.log(today.toDateString());
            console.log(dateToBeCheckOut.toDateString());
            console.log(this.bookingDetailsArrayRealObject[k]);
          }
        }
      }
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript interface to http params 
Typescript :: using typescript with vue 
Typescript :: void function typescript 
Typescript :: order documents in firestore 
Typescript :: Interface with custom property name type 
Typescript :: dart create list from object properties 
Typescript :: stacks and its operaaton code 
Typescript :: How to disable form control but keep value 
Typescript :: how to reset windows update components in windows 
Typescript :: copy contents of multiple files to one file powershell 
Typescript :: Request exceeded the limit of 10 internal redirects due to probable configuration error 
Typescript :: typescript class inheritance 
Typescript :: nest js get request response 
Typescript :: classes in ts 
Typescript :: typescript 
Typescript :: fetch tweets 
Typescript :: Angular Compiler Options to enable AOT compilation 
Typescript :: algorithm that prints if one of the numbers is multiple of the other 
Typescript :: three requirements for laser action 
Typescript :: concat and nunll check in typescript 
Typescript :: This program prompts the user for two numbers, calls a function to determine the smaller number and prints the smaller number that is returned from the function 
Typescript :: export data in Documents outside sandbox in swift 
Typescript :: studying for a sceince test 
Typescript :: missing return type on function @typescript-eslint/explicit-function-return-type 
Typescript :: input adresse ville automatique 
Typescript :: how many energy levels are there 
Typescript :: flutter fab covers widget on keyboard open 
Typescript :: netsuite suitescript to upload and rename a file 
Typescript :: google sheets automatic update rook 
Typescript :: typescript maybe type 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =