|
I have an object array like below
[{id:101, StartTime: "2020-08-26T09:00:00", EndTime: "2020-08-26T18:00:00", Effort: "09:00:00"},
{id:102, StartTime: "2020-08-26T08:30:00", EndTime: "2020-07-02T19:25:00", Effort: "10:55:00"},
{id:103, StartTime: "2020-07-02T00:00:00", EndTime: "2020-07-02T00:00:00", Effort: "00:00:00"},
{id:104, StartTime: "2020-08-26T09:00:00", EndTime: "2020-08-26T18:00:00", Effort: "09:00:00"},
{id:105, StartTime: "2020-09-18T10:00:00", EndTime: "2020-09-18T21:00:00", Effort: "11:00:00"},
{id:106, StartTime: "2020-07-02T00:00:00", EndTime: "2020-07-02T00:00:00", Effort: "00:00:00"},
{id:107, StartTime: "2020-07-02T00:00:00", EndTime: "2020-07-02T00:00:00", Effort: "00:00:00"}]
I need to get the object where the Effort column should be greater than zero minutes
i need result like below
[{id:101, StartTime: "2020-08-26T09:00:00", EndTime: "2020-08-26T18:00:00", Effort: "09:00:00"},
{id:102, StartTime: "2020-08-26T08:30:00", EndTime: "2020-07-02T19:25:00", Effort: "10:55:00"},
{id:104, StartTime: "2020-08-26T09:00:00", EndTime: "2020-08-26T18:00:00", Effort: "09:00:00"},
{id:105, StartTime: "2020-09-18T10:00:00", EndTime: "2020-09-18T21:00:00", Effort: "11:00:00"}]
Thanks
Software Engineer
AcSys IT Software Solution
|
|
|
|
|
Sorry, it's a Sunday, so we're all in church right now. However, while you are waiting for us to come out of church, you might like to read the paragraph at the top of this page, in particular the bit in RED.
|
|
|
|
|
THis is the wrong place to post this, as it says at teh top of the page.
Try here: https://www.codeproject.com/Questions/ask.aspx[^]
But ... While we are more than willing to help those that are stuck that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I like to think that giving the answer in these sorts of cases is something of a curse, as unless you take the effort to understand the answer, you end up with no new knowledge.
const haveExpendedEffort = whateverYourArrayIsCalled.filter((x: any) => {return x.Effort !== '00:00:00';}); I think that there is a certain irony in this solution.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 20-Sep-20 5:00am.
|
|
|
|
|
If you take a minute to think about this, you should realise that you are just wanting to look for records where the effort isn't 00:00:00. Try it out and what you can come up with.
|
|
|
|
|
That's what I thought too when I posted my solution which could be wrong.
The thing is he states "greater than zero minutes", there is the possibility based on that statement that records could contain negative minutes.
But wait for it, it goes even deeper than that as he specifies "zero minutes" which means that "00:00:59" would not meet that criteria if the "59" represented seconds as 59 seconds could be interpreted as zero minutes.
To be completely pedantic, would "24:00:59" meet that criteria as it has zero minutes?
This is why I am not keen on the ambiguity of modern day non-technical specifications also known as user stories.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
- An Oxford comma walks into a bar, where it spends the evening watching television, getting drunk, and smoking cigars.
- A dangling participle walks into a bar. Enjoying a cocktail and chatting with the bartender, the evening passes pleasantly.
- A bar was walked into by the passive voice.
- An oxymoron walked into a bar, and the silence was deafening.
- An alliteration bursts into the bar, barking at the bartender for a beverage. He beamed, "Better be a beer!"
- Two quotation marks walk into a “bar.”
- A malapropism walks into a bar, looking for all intensive purposes like a wolf in cheap clothing, muttering epitaphs and casting dispersions on his magnificent other, who takes him for granite.
- Hyperbole totally rips into this insane bar and absolutely destroys everything.
- A question mark walks into a bar?
- A non sequitur walks into a bar. In a strong wind, even turkeys can fly.
- Papyrus and Comic Sans walk into a bar. The bartender says, "Get out—we don't serve your type."
- A mixed metaphor walks into a bar, seeing the handwriting on the wall but hoping to nip it in the bud.
- A comma splice walks into a bar, it has a drink and then leaves.
- Three intransitive verbs walk into a bar. They sit. They converse. They depart.
- A synonym strolls into a tavern.
- At the end of the day, a cliché walks into a bar—fresh as a daisy, cute as a button, and sharp as a tack.
- A run-on sentence walks into a bar it starts flirting. With a cute little sentence fragment.
- Falling slowly, softly falling, the chiasmus collapses to the bar floor.
- A figure of speech literally walks into a bar and ends up getting figuratively hammered.
- An allusion walks into a bar, despite the fact that alcohol is its Achilles heel.
- The subjunctive would have walked into a bar, had it only known.
- A misplaced modifier walks into a bar owned by a man with a glass eye named Ralph.
- The past, present, and future walked into a bar. The mood was tense.
- A dyslexic walks into a bra.
- A verb walks into a bar, sees a beautiful noun, and suggests they conjugate. The noun declines.
- A simile walks into a bar, as parched as a desert.
- A gerund and an infinitive walk into a bar, drinking to forget.
- A hyphenated word and a non-hyphenated word walk into a bar and the bartender nearly chokes on the irony.
|
|
|
|
|
|
On a golf tour in Ireland, Tiger Woods drives his BMW into a petrol station in a remote part of the Irish countryside.
The pump attendant obviously knows nothing about golf, greets him in a typical Irish manner completely unaware of who the golfing pro is.
Top of the mornin’ to yer, sir” says the attendant.
Tiger nods a quick “hello” and bends forward to pick up the nozzle.
As he does so, two tees fall out of his shirt pocket onto the ground.
“What are dose? asks the attendant.
“They’re called tees” replies Tiger.
“Well, what on the god’s earth are dey for?” inquires the Irishman.
“They’re for resting my balls on when I’m driving”, says Tiger.
*
*
*
“Fookin Jaysus”, says the Irishman, “BMW thinks of everything!"
|
|
|
|
|
|
Geez. Someone is gonna pay like $50k at least for that thing.
I'd rather have a 70's yamaha and strip it down to make a cafe racer, personally
Real programmers use butterflies
|
|
|
|
|
Maybe a 350LC would tempt, but that was 1980 - and nearly all of 'em have been stolen at least once by now.
But a Come'N'Go? Those were good fun. My first one handled better with a flat rear tyre than the Honda it replaced did with properly inflated Pirelli Phantoms...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wow, what a find. Can't imagine owning it and not riding.
I'm not sure how many cookies it makes to be happy, but so far it's not 27.
JaxCoder.com
|
|
|
|
|
The name Norton reminded me of an Editor we used to use in the early nineties - Norton Editor. And later an antivirus suite.
|
|
|
|
|
Nice, but more power than I need.
|
|
|
|
|
|
I had the exact same response, followed by "why the heck would anyone pay 30K for any Norton product!?"
|
|
|
|
|
Sander Rossel wrote: why the heck would anyone pay 30K for any Norton product!?" If it is to uninstal it cleanly...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
But how are you going to uninstall the uninstaller?
|
|
|
|
|
Most (product specific) uninstallers that I have ever seen manage to uninstall themselves.
Obviously, generic uninstallers such as 'msiexec /uninstall' remain.
|
|
|
|
|
Yes, and I can also uninstall most products, but we're talking about Norton here so all bets are off
|
|
|
|
|
Where I live, the sky looks like murder and the trees tremble in gales you could cut with a knife. The smoke makes all of the weather actively malignant.
All I have to do is look outside my window for inspiration.
Now if only I could breathe.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Where I live, the sky looks like murder and the trees tremble in gales you could cut with a knife. The smoke makes all of the weather actively malignant.
Unable to interpret it!
honey the codewitch wrote: look outside my window for inspiration.
Awesome weather?
|
|
|
|
|
honey the codewitch wrote: The smoke
Do you live in Portland or Minneapolis?
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
heh
near Seattle actually
Real programmers use butterflies
|
|
|
|
|