December 11, 200223 yr Newbies Is there any way to force the correct date format when CDML is written to the HTML page ? I need to pull a date field out of FM5 in the format dd/mm/yyyy - which is the format it's stored in the database. however, any leading zeros are being stripped ie 02/02/2003 become 2/2/2003. Is there any way to force the correct format when CDML is written to the HTML page ? Dazzjazz
December 11, 200223 yr dazzjazz There's a whole slew of date-related posts that I cannot remember exactly but I do recall mention that FM date format is dependent upon your own computer's date format... it's not a FM thing (although there were Euro/U.S. issues). Maybe your own computer can be set to store it that way so you don't have to reformat it. Or maybe you can convert it to a text field and use a calc field to manipulate it to look the way you want. If not, I'm sure someone can help you using JavaScript or something. Anyone else out there have a lead for dazzjazz?
April 8, 200322 yr hello all + Garry! this:[FMP-Field:myDate,format] works just fine but is there a way to assign it as the part of the varible in JavaScript..... if you remember the part: curr_date = "[FMP-Field:Date,format]"; .... .... document.write(" + curr_date + ") however, the write part doesn't work?! Is there a trick to this thank you!
April 8, 200322 yr noting really happens...the doc.write doesn't create any output...the page is opened by noting written. I can't use just document.write(curr_date) because the string is a bit longer, I just posted the part of it. here is the entire string: document.write("<tr><td background='/images/line.jpg' height='22'><strong><a href="#" onclick="showdetails('" + curr_date + "','"+ curr_loc +"');">" + curr_date + "</strong></td><td background='/images/line.jpg' height='22' align='center'>" + loc_qty + "</td><td background='/images/line.jpg' height='22'> $ " + loc_amnt + "</td></tr>"); the problem/issue starts arround that showdetails(... maybe you can help... thank you sir!
April 9, 200322 yr just wanted to keep the post going...I am still looking for an answer to this JavaScript issue! Any gurus outhere?
April 9, 200322 yr When you view the source of the page, after it is loaded into the browser, what does this look like: curr_date = "[FMP-Field:Date,format]" Does it look like this: curr_date = "Apr 8 2003" (or something similar) Good Luck. Garry
April 9, 200322 yr "Thu,Dec 25,1997" ...I am not quite sure if I can "mix" text and digits like this Thank you Sir!
April 10, 200322 yr Here is a "hard-wired" version which works: <html lang="en"> <head> <title>test3</title> <meta name="generator" content="BBEdit 7.0.3"> <script> function showdetails(currdate,currloc) { alert(currdate + "<br>" + currloc); }; </script> </head> <body>Loading... <table> <script> curr_date = "Thu,Dec 25,1997"; curr_loc = "Anywhere"; loc_qty = 200; loc_amnt = 1000; document.write("<tr><td height='22'><strong><a href="#" onclick="showdetails('" + curr_date + "','"+ curr_loc +"');">" + curr_date + "</strong></td><td height='22' align='center'>" + loc_qty + "</td><td height='22'> $ " + loc_amnt + "</td></tr>"); </script> </table></body> </html> Good Luck. Garry
April 10, 200322 yr so in other words...it should work the same with JS loop. Ok, thank you Garry ... I will "comb" my code for errors.
April 10, 200322 yr should = does not I don't know what to say...If I change curr_date = "[FMP-Field:Date]"; to curr_date = "[FMP-Field:Date,format]"; none of the document.write statements work/get executed....remove the format part and all is OK!? I can get it to work under "normal" circumstances such as form/inline --> submit-->results: [FMP-Record] [FMP-Field:Date,format] [/FMP-Record] one of those things.....I guess
April 10, 200322 yr I'm just a curious bystander. What would happen if you tried curr_date = "[FMP-Field:Date,raw]"; ?
April 11, 200322 yr My Golden Rule: If something doesn't work on web, create calculation text field with required output. It works in all web situation from WC to Lasso.
April 11, 200322 yr no Lasso for me....[FMP-Record:my boss does not want to pay for nothing...why do you think his netadmin is doing webdesign]
April 11, 200322 yr So if contributors to these forums no longer provide you with free help which results in you spending greater time to accomplish the things you post about, will your boss gain a better understanding of economics or fire you and hire someone even cheaper, albeit less knowledgeable? We all understand that your boss won't (can't) do the job.
April 11, 200322 yr I sometimes use the Calculated field method for formating data. You can also use Javascript. Here is some code I use for testing date formatting: <body><script> [FMP-Record] mydate = "[FMP-Field:last_app]".split("/"); myday = mydate[0]; mymonth = mydate[1]; myyear = mydate[2]; testdate = new Date("[FMP-Field:last_app]"); document.write("Day is " + myday + " Month is " + mymonth + " Year is " + myyear + "<br>"); document.write("My date is " + testdate.toLocaleString() + "<br>"); [/FMP-Record]</script> </body> Hope this is of interest. Garry
April 17, 200322 yr UNABLE: yeah...I wish he just hired FM programmer at the begining of FM saga. In that case all I would worry about is opnening the ports and running backups but then again I would have never joined this forum...met bunch of nice people...and above all learned something new in life (easy or the hard way) which is why I raised my hand for the job in the first place! p.s. forum is MY tool not his...
Create an account or sign in to comment