If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to change what day the week stars with

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-08-02, 03:31
defsteph defsteph is offline
Registered User
 
Join Date: Nov 2002
Posts: 8
Angry How do I change what day the week starts with?

Ok, I've been up all night trying to do this, but i guess i'm just not good enough...

Anyway...
I'm trying to do a calendar, that starts on Monday and end on Sunday (like the week does in my part of the world). One would think this is automized like so much else when using the LCID. This is unfortunately not the case.

So any ideas on how i could go about this? without having to rewrite the entire script? or rather, having to change everything in it. Any and all comments that can lead to my succeeding in this "endeavour" are highly appreciated.

PIS!
/Stephan

Last edited by defsteph; 11-08-02 at 06:29.
Reply With Quote
  #2 (permalink)  
Old 11-22-02, 13:19
hellur hellur is offline
Registered User
 
Join Date: Nov 2002
Posts: 10
Well not sure what you want but hope this will be a great suport
.asp site that list from start of month to last day of month
and start on the day its start and end on the day nice lined up.

just copy text and creat your own asp site of it!

<%

'response.write weekday(#2002-11-1#)
int caDay
int caMonth
int caYear

caYear = year(now())
caMonth = month(now())
caDay = 1


response.write "To day its " & caYear & "/" & caMonth & "/" & day(now()) & "<br>"
response.write "Weekday " & weekday(now()) & "<br>"

'Of some strange stupid thing my weekdays are listed
'1 = Sunday
'2 = Monday
'....
'7 = Suterday
'If its wrong for you mod this cod




%>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td>M</td>
<td>T</td>
<td>W</td>
<td>T</td>
<td>F</td>
<td>S</td>
<td>S</td>
</tr>
<tr>
<%

for i = 3 to weekday(cdate(caYear & "/" & caMonth & "/" & caDay))
%>
<td></td>
<%
next
if weekday(cdate(caYear & "/" & caMonth & "/" & caDay)) = 1 then
for i = 1 to 6
%>
<td></td>
<%
next
end if
do while month(cdate(caYear & "/" & caMonth & "/" & caDay) + 1) = caMonth

if weekday(cdate(caYear & "/" & caMonth & "/" & caDay)) = 2 then
%>
<tr>
<%
end if
%>
<td>
<%= caday %>
</td>
<%
if weekday(cdate(caYear & "/" & caMonth & "/" & caDay)) = 1 then
%>
</tr>
<%
end if
caDay = caDay + 1
loop
%>
<td><%= caday %></td>
</tr>
</table>
Reply With Quote
  #3 (permalink)  
Old 11-22-02, 14:27
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
since you are using asp, i will guess that your database is access or sql/server

both of those databases have options to set the first day of the week

check the access help file, or sql/server books online

if you aren't using a database to generate your calendar, then i guess i don't understand the question


rudy
Reply With Quote
  #4 (permalink)  
Old 11-26-02, 17:56
brandonh6k brandonh6k is offline
Registered User
 
Join Date: Nov 2002
Posts: 11
Actually, I think the First Day of Week setting is an OS setting (as specified by the NLS API). Vbscript and ASP don't really care what the first day of the week is for the most part (a couple of exceptions are DatePart and DateDiff functions). I'm betting that you will need to recode whatever application to have a configurable first day of week or the one that you want at least.

Looking at the LCID information, it appears that it only controls how a date (or currency) is displayed, not the more involved issue of when the week actually starts...

Hope this helps...
__________________
- Brandon
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On