• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need someone with Java experience

Explorer ,
Nov 29, 2006 Nov 29, 2006

Copy link to clipboard

Copied

I have the attached java code for a popup calendar. Currently when you click on the date it return and displays the date as day-month-year. Day is two digits, month 2, and year 4 and it also displays the time. I would like for it to display the date as month-day-year (year can be 4 or 2 does not matter) and the time. Can someone please show me where to change this? I am totally lost when it comes to java.
Thanks
TOPICS
Advanced techniques

Views

644

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Nov 30, 2006 Nov 30, 2006
Thank you both, works like a charm!

Votes

Translate

Translate
Advisor ,
Nov 29, 2006 Nov 29, 2006

Copy link to clipboard

Copied

FYI, this is JavaScript, not Java. They are not the same thing.

Anyway, just replace the dt2dtstr code with this:

function dt2dtstr (dt_datetime) {
return (new String (
(dt_datetime.getMonth()+1)+"-"+dt_datetime.getDate()+"-"+dt_datetime.getFullYear()+" "));
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 29, 2006 Nov 29, 2006

Copy link to clipboard

Copied

And replace the str2dt function ..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 29, 2006 Nov 29, 2006

Copy link to clipboard

Copied

quote:

Originally posted by: cf_dev2
And replace the str2dt function ..

Yes, good catch.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2006 Nov 30, 2006

Copy link to clipboard

Copied

Thank you both, works like a charm!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2006 Nov 30, 2006

Copy link to clipboard

Copied

One more thing, if I want to get ride of the time, what do I remove?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 30, 2006 Nov 30, 2006

Copy link to clipboard

Copied

quote:

Originally posted by: mkt
One more thing, if I want to get ride of the time, what do I remove?


That's slightly trickier.

Replace the javascript file with the attached.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 04, 2006 Dec 04, 2006

Copy link to clipboard

Copied

LATEST
Thank you very much - works perfect!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 30, 2006 Nov 30, 2006

Copy link to clipboard

Copied

A quick and dirty way is simply hide the timestamp box and set the value to "". A Long way is dig through the code and remove all references to time objects like document.cal.time.value or dt2tmstr function.



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 30, 2006 Nov 30, 2006

Copy link to clipboard

Copied

Nevermind. That'll work too 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation