Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
404 views
in Technique[技术] by (71.8m points)

typescript - How to verify the dates are displayed correctly from array by ascending and descending order

I have captured the dates from array by using below code, and I need a help how I can verify the displayed dates are displayed correctly in ascending and descending order.

  await mailbox.mailbox_mailboxlist.map(async(ele) => {
    if (ele != undefined) {
        ele.getText().then((text)=> {
            //console.log(text);
            let x = text.split("
");
            console.log("Dates  :"+x[2]);

        });
    }
})

Console output:

Dates  :Wed 30 Dec 2020 10.59am
Dates  :Wed 30 Dec 2020 10.59am
Dates  :Tue 29 Dec 2020 3.18pm
Dates  :Thu 22 Oct 2020 10.47am

And my next validation is to verify the above dates are displayed in ascending order .


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...