Solved

Date issue with java script

Posted on 2011-09-11
5
192 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Receive file in Servlet 1 36
pairs challenge 5 46
firstChar challenge 13 87
Eclipse Neon and jdk 1.8.0 11 72
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now