[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

Date arithmetic

Swifty

11/11/2014 12:39:00 PM

In the past, I might have tackled the following question myself, but my
abilities are waning as I get older, so I'll definitely need some help.
Also, this is just the first of three steps that I have to get through,
so it gets more complicated.

I have a form which contains two date fields (ID's "from" and "to", if
you like) and they are filled with a date-filler script in the format
yyyy-mm-dd

There is also an ID=profile field which will contain one word, but I'll
get to that later, probably in a separate thread (depending on how I get
on with this one...)

If all three fields are non-blank (and we can ignore error checking as
this code if for my benefit only) then how can I subtract the two dates,
to get the number of days (where 2014-11-11 to 2014-11-12 would be 1 day)

That's step 1. Steps 2 and 3 are:

2. Each of the profiles has a different number assigned (decimal, 2
places). So work out the number. This can be a large If-then-else-if
clause; there are fewer than 40 profiles. Looking things up in a file
would be an embelishment.

3. Multiply the decimal number from step 2 by the number derived from
step 1 and divide by 7, rounded to 2 decimal places. Put the result into
a field with ID=amount

In simple English:
We have visitors to our holiday cottage.
They each have a different weekly rate (different by pennies, the
difference allows me to track payments in my bank statement, and know
who paid what)
After I've entered the "from" and "to" and "profile" fields, I want the
"Amount" field to be populated with the charge, based on the number of
days of the visit.

I prefer to do this in stages as, capable or not, I'd still like to
understand how the result is achieved. I can probably fathom the
individual steps.

--
Steve Swift
http://www.swift...
105 Answers

David1950

4/21/2014 6:14:00 PM

0


"Gunner Asch" <gunnerasch@gmail.com> wrote in message
news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
: On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
: <David@eternalsep.net> wrote:
:
: >you need to research your own birth records
: >
: >or don't they keep track of trips to the hillbilly outhouse ??
: >
: >see if you can find THE GLOB!! in there too
:
: Is that the best you can do?
:
: Arnt you ashamed of yourself? You should be. That was utterly
: pathetic.
:
: Gunner
:



says the hillbilly ass gunner


Jeff M

4/21/2014 7:17:00 PM

0

On 4/21/2014 1:14 PM, David 1950 wrote:
> "Gunner Asch" <gunnerasch@gmail.com> wrote in message
> news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
> : On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
> : <David@eternalsep.net> wrote:
> :
> : >you need to research your own birth records
> : >
> : >or don't they keep track of trips to the hillbilly outhouse ??
> : >
> : >see if you can find THE GLOB!! in there too
> :
> : Is that the best you can do?
> :
> : Arnt you ashamed of yourself? You should be. That was utterly
> : pathetic.
> :
> : Gunner


> says the hillbilly ass gunner

It isn't necessary to insult hillbillies.


--
?The modern conservative is engaged in one of man's oldest exercises in
moral philosophy; that is, the search for a superior moral justification
for selfishness.? - John Kenneth Galbraith

Gunner Asch

4/21/2014 9:23:00 PM

0

On Mon, 21 Apr 2014 14:14:05 -0400, "David 1950"
<David@eternalsep.net> wrote:

>
>"Gunner Asch" <gunnerasch@gmail.com> wrote in message
>news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
>: On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
>: <David@eternalsep.net> wrote:
>:
>: >you need to research your own birth records
>: >
>: >or don't they keep track of trips to the hillbilly outhouse ??
>: >
>: >see if you can find THE GLOB!! in there too
>:
>: Is that the best you can do?
>:
>: Arnt you ashamed of yourself? You should be. That was utterly
>: pathetic.
>:
>: Gunner
>:
>
>
>
>says the hillbilly ass gunner
>
I live in California and you call me a Hillbilly? Odd. Blue States
have hillbillies? Its obvious that Blue States have retarded
losers..you prove that well enough. But I dont even live in the
hills.

You and your Nazi bretheren really are pigs before the slaughterhouse
door.

Shrug


--

"
I was once told by a ?gun safety? advocate back in the Nineties
that he favored total civilian firearms confiscation.
Only the military and police should have weapons he averred and what did I think about that?

I began to give him a reasoned answer and he
cut me off with an abrupt, ?Give me the short answer.?

I thought for a moment and said, ?If you try to take our firearms we will kill you.?"

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www...

BIG Bird

4/21/2014 9:28:00 PM

0


"Jeff M" <NoSpam@NoThanks.org> wrote in message
news:YJGdnYvaQs4F88jOnZ2dnUVZ_radnZ2d@giganews.com...
: On 4/21/2014 1:14 PM, David 1950 wrote:
: > "Gunner Asch" <gunnerasch@gmail.com> wrote in message
: > news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
: > : On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
: > : <David@eternalsep.net> wrote:
: > :
: > : >you need to research your own birth records
: > : >
: > : >or don't they keep track of trips to the hillbilly outhouse ??
: > : >
: > : >see if you can find THE GLOB!! in there too
: > :
: > : Is that the best you can do?
: > :
: > : Arnt you ashamed of yourself? You should be. That was utterly
: > : pathetic.
: > :
: > : Gunner
:
:
: > says the hillbilly ass gunner
:
: It isn't necessary to insult hillbillies.
:


I know that

but it sure is fun

payback, so to speak

and,

it's their own fault,

they make themselves objects ripe for ridicule


BeamMeUpScotty

4/21/2014 9:29:00 PM

0

On 4/21/2014 5:23 PM, Gunner Asch wrote:
> On Mon, 21 Apr 2014 14:14:05 -0400, "David 1950"
> <David@eternalsep.net> wrote:
>
>>
>> "Gunner Asch" <gunnerasch@gmail.com> wrote in message
>> news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
>> : On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
>> : <David@eternalsep.net> wrote:
>> :
>> : >you need to research your own birth records
>> : >
>> : >or don't they keep track of trips to the hillbilly outhouse ??
>> : >
>> : >see if you can find THE GLOB!! in there too
>> :
>> : Is that the best you can do?
>> :
>> : Arnt you ashamed of yourself? You should be. That was utterly
>> : pathetic.
>> :
>> : Gunner
>> :
>>
>>
>>
>> says the hillbilly ass gunner
>>
> I live in California and you call me a Hillbilly? Odd. Blue States
> have hillbillies?


California "We think everyone out there is inbred or gay or both."

They say come see for yourself.







BIG Bird

4/21/2014 9:29:00 PM

0


"Gunner Asch" <gunnerasch@gmail.com> wrote in message
news:st2bl9d4k3kcggaqcot317itq12qhintki@4ax.com...
: On Mon, 21 Apr 2014 14:14:05 -0400, "David 1950"
: <David@eternalsep.net> wrote:
:
: >
: >"Gunner Asch" <gunnerasch@gmail.com> wrote in message
: >news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
: >: On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
: >: <David@eternalsep.net> wrote:
: >:
: >: >you need to research your own birth records
: >: >
: >: >or don't they keep track of trips to the hillbilly outhouse ??
: >: >
: >: >see if you can find THE GLOB!! in there too
: >:
: >: Is that the best you can do?
: >:
: >: Arnt you ashamed of yourself? You should be. That was utterly
: >: pathetic.
: >:
: >: Gunner
: >:
: >
: >
: >
: >says the hillbilly ass gunner
: >
: I live in California and you call me a Hillbilly? Odd. Blue States
: have hillbillies? Its obvious that Blue States have retarded
: losers..you prove that well enough. But I dont even live in the
: hills.
:
: You and your Nazi bretheren really are pigs before the slaughterhouse
: door.
:
: Shrug
:
:

you can take the hillbilly out of the hills, but you can't take the hills out of
the gomer


Gunner Asch

4/22/2014 2:14:00 AM

0

On Mon, 21 Apr 2014 17:29:21 -0400, "GLOBALIST" <Snordo@Teranews.com>
wrote:

>
>"Gunner Asch" <gunnerasch@gmail.com> wrote in message
>news:st2bl9d4k3kcggaqcot317itq12qhintki@4ax.com...
>: On Mon, 21 Apr 2014 14:14:05 -0400, "David 1950"
>: <David@eternalsep.net> wrote:
>:
>: >
>: >"Gunner Asch" <gunnerasch@gmail.com> wrote in message
>: >news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
>: >: On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
>: >: <David@eternalsep.net> wrote:
>: >:
>: >: >you need to research your own birth records
>: >: >
>: >: >or don't they keep track of trips to the hillbilly outhouse ??
>: >: >
>: >: >see if you can find THE GLOB!! in there too
>: >:
>: >: Is that the best you can do?
>: >:
>: >: Arnt you ashamed of yourself? You should be. That was utterly
>: >: pathetic.
>: >:
>: >: Gunner
>: >:
>: >
>: >
>: >
>: >says the hillbilly ass gunner
>: >
>: I live in California and you call me a Hillbilly? Odd. Blue States
>: have hillbillies? Its obvious that Blue States have retarded
>: losers..you prove that well enough. But I dont even live in the
>: hills.
>:
>: You and your Nazi bretheren really are pigs before the slaughterhouse
>: door.
>:
>: Shrug
>:
>:
>
>you can take the hillbilly out of the hills, but you can't take the hills out of
>the gomer
>
As you leftists demonstrate with each of your posts. There is a
Reason that the KKK was formed and run for all of its history by
Democrats.

Yall are hate filled idiots of the first water.

Gunner

--

"
I was once told by a ?gun safety? advocate back in the Nineties
that he favored total civilian firearms confiscation.
Only the military and police should have weapons he averred and what did I think about that?

I began to give him a reasoned answer and he
cut me off with an abrupt, ?Give me the short answer.?

I thought for a moment and said, ?If you try to take our firearms we will kill you.?"

BIG Bird

4/22/2014 3:36:00 AM

0


"Gunner Asch" <gunnerasch@gmail.com> wrote in message
news:80kbl9tufn394esl3plmnctf2c6orrm9i7@4ax.com...
: On Mon, 21 Apr 2014 17:29:21 -0400, "GLOBALIST" <Snordo@Teranews.com>
: wrote:
:
: >
: >"Gunner Asch" <gunnerasch@gmail.com> wrote in message
: >news:st2bl9d4k3kcggaqcot317itq12qhintki@4ax.com...
: >: On Mon, 21 Apr 2014 14:14:05 -0400, "David 1950"
: >: <David@eternalsep.net> wrote:
: >:
: >: >
: >: >"Gunner Asch" <gunnerasch@gmail.com> wrote in message
: >: >news:hcp8l9ptl85a4b8fc1ttcotjcr5iah7e00@4ax.com...
: >: >: On Sat, 19 Apr 2014 22:44:27 -0400, "David 1950"
: >: >: <David@eternalsep.net> wrote:
: >: >:
: >: >: >you need to research your own birth records
: >: >: >
: >: >: >or don't they keep track of trips to the hillbilly outhouse ??
: >: >: >
: >: >: >see if you can find THE GLOB!! in there too
: >: >:
: >: >: Is that the best you can do?
: >: >:
: >: >: Arnt you ashamed of yourself? You should be. That was utterly
: >: >: pathetic.
: >: >:
: >: >: Gunner
: >: >:
: >: >
: >: >
: >: >
: >: >says the hillbilly ass gunner
: >: >
: >: I live in California and you call me a Hillbilly? Odd. Blue States
: >: have hillbillies? Its obvious that Blue States have retarded
: >: losers..you prove that well enough. But I dont even live in the
: >: hills.
: >:
: >: You and your Nazi bretheren really are pigs before the slaughterhouse
: >: door.
: >:
: >: Shrug
: >:
: >:
: >
: >you can take the hillbilly out of the hills, but you can't take the hills out
of
: >the gomer
: >
: As you leftists demonstrate with each of your posts. There is a
: Reason that the KKK was formed and run for all of its history by
: Democrats.
:
: Yall are hate filled idiots of the first water.
:
: Gunner
:
LMAO

the kkk were never anything but a bunch of fat ass,ugly,stupid hillbilly pussies

the FBI was always able to infiltrate those idiots and have them ALL rat each
other out

and they were always 100% hillbilly, democrat before the civil rights act and
republicans since


Gunner Asch

4/22/2014 7:52:00 AM

0

On Mon, 21 Apr 2014 23:35:30 -0400, "GLOBALIST" <Snordo@Teranews.com>
wrote:

>: >
>: As you leftists demonstrate with each of your posts. There is a
>: Reason that the KKK was formed and run for all of its history by
>: Democrats.
>:
>: Yall are hate filled idiots of the first water.
>:
>: Gunner
>:
> LMAO
>
>the kkk were never anything but a bunch of fat ass,ugly,stupid hillbilly pussies

Odd..it appears that you know little about your parties other
activities. How can you face yourself in the mirror each morning
without wanting to slit your own wrists?

http://hnn.us/ar...


>
>the FBI was always able to infiltrate those idiots and have them ALL rat each
>other out

Really? You do know that there are hundreds of dead (Republican) civil
rights workers who were murdered that were never solved.

>
>and they were always 100% hillbilly, democrat before the civil rights act and
>Democrats since

Fixed that for you. You keep trying to lie and dont do it very well.


https://sites.google.com/site/tomiolsonma/a-proud-legacy-of...

But then..you Klanners never were very smart. And nearly universally
pychopathic. A common issue among Democrats today.

When you are all bulldozed into mass graves..the nation will be a far
better place.

Gunner

--

"
I was once told by a ?gun safety? advocate back in the Nineties
that he favored total civilian firearms confiscation.
Only the military and police should have weapons he averred and what did I think about that?

I began to give him a reasoned answer and he
cut me off with an abrupt, ?Give me the short answer.?

I thought for a moment and said, ?If you try to take our firearms we will kill you.?"

BIG Bird

4/22/2014 10:13:00 AM

0


"Gunner Asch" <gunnerasch@gmail.com> wrote in message
news:o17cl91v1c92t1m68f5qpucm9j433apcuo@4ax.com...
: On Mon, 21 Apr 2014 23:35:30 -0400, "GLOBALIST" <Snordo@Teranews.com>
: wrote:
:
: >: >
: >: As you leftists demonstrate with each of your posts. There is a
: >: Reason that the KKK was formed and run for all of its history by
: >: Democrats.
: >:
: >: Yall are hate filled idiots of the first water.
: >:
: >: Gunner
: >:
: > LMAO
: >
: >the kkk were never anything but a bunch of fat ass,ugly,stupid hillbilly
pussies
:
: Odd..it appears that you know little about your parties other
: activities. How can you face yourself in the mirror each morning
: without wanting to slit your own wrists?
:



LMAO


use that shit on other stupid crackers like yourself gomer,

those southern democrats were never part of my party