Solved

Date issue with java script

Posted on 2011-09-11
5
196 Views
Last Modified: 2012-05-12
Hello all I am getting this value 15_D which has a date format. I am placing into a var ret22 and I would like to keep in ret22 with a diffrent format. The currect format is gives me is •MM/dd/yyyy
. I would like to cahnge to •MMMM dd, yyyy

PLease advise what I have to do. Thanks
var ret22 = this.getField("15_D").value;
0
Comment
Question by:eteran
  • 3
  • 2
5 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36519905

What this has to do with Java Programming Language?

And which date it is - is it !5th of December ?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36520009


You can look at thios date function for formatting date in hjava script:
http://stevenlevithan.com/assets/misc/date.format.js

and description of how to use is here:

http://blog.stevenlevithan.com/archives/date-time-format

But still it is good to know what is "15_D" ?

0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 36520261

var ret22 = this.getField("15_D").value;

var months = [ "January", "February", "March","April","May","June", "July","August","September", "October", "November","December"];
var arr = ret22.split("/");
ret22 = months[ parseInt(arr[0]) ] + " " + arr[1] + "," + arr[2];

Open in new window


A good article about date : http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_484-Can-I-have-a-date.html
Don't forget to vote ;-)
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36520265
@for_yan

We're in Acrobat Javascript world :
15_D is a field in a PDF Form
http://wiki.scribus.net/canvas/How_to_enhance_your_PDF_forms_with_JavaScript
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36520270
I see. Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
map related example 6 55
hibernate insert example 13 34
servlet and mdb, jms error 1 32
junit as external jar or library 7 22
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question