[FX.php List] [OFF] Javascript question--comparing dates

Fitzgerald, Theodore C ted-fitzgerald at uiowa.edu
Thu Dec 4 08:18:40 MST 2014


Bob,

Not sure if you missed my post, so here it is again:


In order to do the greater than and less than comparison you'll need to be working with Date objects, so if getToday() doesn't return a date object, your function won't work correctly.



I'm not sure what "getToday();" is doing, but to get today's date,  you only need to do "new Date()";.  Here is an example of it working:



http://jsfiddle.net/qpvugLna/1/ (warning, it does show the alert when you visit the page)



Ted

Application Developer
ITS-Enterprise Services
2800 UCC
University of Iowa

From: fx.php_list-bounces at mail.iviking.org [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Bob Patin
Sent: Thursday, December 04, 2014 8:49 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] [OFF] Javascript question--comparing dates

It is, but it’s just a simple bit of code.

I tried for an hour to get it to work; I tried translating the dates to milliseconds and then doing math comparisons, but I never got it to work. I’m going to work around it by doing it in PHP, but I would have thought that there would be a simple way to do date comparisons in Javascript… oh well.


Bob Patin
Longterm Solutions
bob at longtermsolutions.com<mailto:bob at longtermsolutions.com>
615-333-6858
FileMaker 9, 10, 11, 12 & 13 Certified Developer
http://www.longtermsolutions.com
-
iChat: bobpatin at me.com<mailto:bobpatin at me.com>
Twitter: bobpatin
—
FileMaker Consulting
FileMaker Hosting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting

On Dec 3, 2014, at 1:53 PM, Ness, David <dness at bondedbuilders.com<mailto:dness at bondedbuilders.com>> wrote:

Bob,

Since getToday() isn't a JavaScript function, I assume it's a custom function?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20141204/5652831c/attachment.html


More information about the FX.php_List mailing list