Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2002
    Posts
    8

    Angry Unanswered: 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 07:29.

  2. #2
    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>

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •