JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 16th, 2004, 02:03 PM
bryanpl bryanpl is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 bryanpl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Format Date On Page Load

All:

I am filling a html form with some data from SQL server. I would rather not format the date from within the stored procedure but have the date formated as it's loaded into the web page. Is this possible using javascript and if so how.

Thanks in advance

Reply With Quote
  #2  
Old July 16th, 2004, 02:06 PM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 10 m 18 sec
Reputation Power: 14
Send a message via AIM to jacktasia
there are few questions that could more easily be answered by searching google.

but, welcome to the fourms!

and please read how to post a question if you already have not:
http://forums.devshed.com/t157126/s.html

Reply With Quote
  #3  
Old July 16th, 2004, 02:27 PM
bryanpl bryanpl is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 bryanpl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, I tried searching google but could not come up with an answer.

I don't need the format for data input, I need the date formatted as it's loaded into the control from the stored procedure.

Reply With Quote
  #4  
Old July 16th, 2004, 02:29 PM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 10 m 18 sec
Reputation Power: 14
Send a message via AIM to jacktasia
Quote:
Originally Posted by bryanpl
Thanks, I tried searching google but could not come up with an answer.

I don't need the format for data input, I need the date formatted as it's loaded into the control from the stored procedure.


okay, so how it's it stored and how do you want it displayed?

Reply With Quote
  #5  
Old July 16th, 2004, 02:37 PM
bryanpl bryanpl is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 bryanpl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Stored in database as dd/mm/yy. i would like it to be displayed as dd-mmm - yy

e.g. 01/12/04 01-Dec-04

Thanks in advance

-=Bryan=-

Reply With Quote
  #6  
Old July 16th, 2004, 02:46 PM
jacktasia jacktasia is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: Lawrence, Kansas [KU]
Posts: 1,559 jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level)jacktasia User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 14 h 10 m 18 sec
Reputation Power: 14
Send a message via AIM to jacktasia
Code:
<script language="javascript">
<!--
function formatDate(fs) {
	var theMonths= new Array();
	theMonths[0]="Jan";
	theMonths[1]="Feb";
	theMonths[2]="Mar";
	theMonths[3]="Apr";
	theMonths[4]="May";
	theMonths[5]="Jun";
	theMonths[6]="Jul";
	theMonths[7]="Aug";
	theMonths[8]="Sep";
	theMonths[9]="Oct";
	theMonths[10]="Nov";
	theMonths[11]="Dec";
	
	var fs = fs.split('/');
	return fs[0] + "-"  + theMonths[Number(fs[1]-1)] + "-" + fs[2];
}
//-->
</script>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Format Date On Page Load

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap