Avatar billede dtc Nybegynder
06. juli 2005 - 10:32 Der er 13 kommentarer og
1 løsning

Datoformat 1033 kan det gøres på anden måde?

Jeg har tilrettet Ocean12´s kalender - men kan ikke greje datoformat. Jeg har pt. sat LCID=1033 ind for amerikansk datoformat....MEN er der ikke en metode så man ikke skal tænke omvendt?

Dvs. pt. når jeg skal taste den 08.07.05 ind - så skal jeg vælge August - 7 - 2005 for at det kommer til at stå korrekt....kan MAN ikke lave det på en anden måde????

< KODEN FRA Date.asp siden>

<%

navmonth = request.querystring("month")
navyear = request.querystring("year")

If navmonth = "" Then
    navmonth = Month(Date)
End If

If navyear = "" Then
    navyear = Year(Date)
End If

Session.LCID = 1033
firstday = Weekday(CDate(navmonth & "/" & 1 & "/" & navyear))


leapTestNumbers = navyear / 4
leapTest = (leapTestNumbers) - Round(leapTestNumbers)
If navmonth = 2 Then
    If leapTest <> 0 Then
        lastDate = 28
    Else
        lastDate = 29
    End If
ElseIf ((navmonth = 4) OR (navmonth = 6) OR (navmonth = 9) OR (navmonth = 11)) Then
    lastDate = 30
Else
    lastDate = 31
End If

lastMonth = navmonth - 1
lastYear = navyear
If lastMonth < 1 Then
    lastMonth = 12
    lastYear = lastYear - 1
End If

nextMonth = navmonth + 1
nextYear = navyear
If nextMonth >12 Then
    nextMonth = 1
    nextYear = nextYear + 1
End If


dateCounter = 1
weekCount = 1

DateEnd = lastDate
DateBegin = firstDate

Weekday_Font = RSBODY("Weekday_Font")
Weekday_Font_Size = RSBODY("Weekday_Font_Size")
Weekday_Font_Color = RSBODY("Weekday_Font_Color")
Weekday_Background_Color = RSBODY("Weekday_Background_Color")
Date_Font = RSBODY("Date_Font")
Date_Font_Size = RSBODY("Date_Font_Size")
Date_Font_Color = RSBODY("Date_Font_Color")
Date_Background_Color = RSBODY("Date_Background_Color")
Event_Font = RSBODY("Event_Font")
Event_Font_Size = RSBODY("Event_Font_Size")
Event_Font_Color = RSBODY("Event_Font_Color")
Cell_Width = RSBODY("Cell_Width")
Cell_Height = RSBODY("Cell_Height")
Cell_Background_Color = RSBODY("Cell_Background_Color")
Border_Size = RSBODY("Border_Size")
Border_Color = RSBODY("Border_Color")
%>
Avatar billede fennec Nybegynder
06. juli 2005 - 10:37 #1
Kan du ikke bare bruge lcid=1030 som er dansk format (dd-mm-yyyy)??
Avatar billede dtc Nybegynder
06. juli 2005 - 10:49 #2
nej - har prøvet - det virker ikke - den laver bl.a. om på datoerne - dvs. eks. laver den d. 8 august til en fredag - selvom det er en mandag!!! Siden er hostet hos wannafind - har det noget at sige?
Avatar billede fennec Nybegynder
06. juli 2005 - 11:03 #3
Jeg ville også flytte lcid op ovenover:
Session.LCID = 1033
navmonth = request.querystring("month")

ellers kører den month(date) year(date) funktion der kommer lige efter på standart format, og ikke det du vælger. Lcid skal altid stå som noget af det aller første kode.

Har du et sted man kan se det i aktion??
Avatar billede dtc Nybegynder
06. juli 2005 - 11:07 #4
Jeg flytter det lige op over!

ja da..... www.a-vision.dk/kalender

Prøv evt. at ligge en event ind....www.a-vision.dk/kalender/admin

Brugernavn: admin  - Pass: livaliva
Avatar billede fennec Nybegynder
06. juli 2005 - 12:31 #5
Ændre du på "firstday" senere i koden??
Avatar billede dtc Nybegynder
06. juli 2005 - 13:12 #6
nej ikke mig bevidst
Avatar billede fennec Nybegynder
06. juli 2005 - 14:18 #7
Så skal vi nok se hele koden for at finde ud af det.
Avatar billede dtc Nybegynder
06. juli 2005 - 14:19 #8
her er den for default.asp


<!--#include file="dsn.asp"-->
<!--#include file="body.asp"-->
<html>
<head>
<title><%=RSBODY("Page_Title")%></title>

<!--#include file="style.asp"-->

</head>
<body bgcolor="<%=RSBODY("Background_Color")%>" text="<%=RSBODY("Font_Color")%>" link="<%=RSBODY("Link_Color")%>" vlink="<%=RSBODY("Visited_Link_Color")%>" alink="<%=RSBODY("Active_Link_Color")%>">
<% Session.LCID = 1033 %>
<%

navmonth = request.querystring("month")
navyear = request.querystring("year")

If navmonth = "" Then
    navmonth = Month(Date)
End If

If navyear = "" Then
    navyear = Year(Date)
End If


firstday = Weekday(CDate(navmonth & "/" & 1 & "/" & navyear))


leapTestNumbers = navyear / 4
leapTest = (leapTestNumbers) - Round(leapTestNumbers)
If navmonth = 2 Then
    If leapTest <> 0 Then
        lastDate = 28
    Else
        lastDate = 29
    End If
ElseIf ((navmonth = 4) OR (navmonth = 6) OR (navmonth = 9) OR (navmonth = 11)) Then
    lastDate = 30
Else
    lastDate = 31
End If

lastMonth = navmonth - 1
lastYear = navyear
If lastMonth < 1 Then
    lastMonth = 12
    lastYear = lastYear - 1
End If

nextMonth = navmonth + 1
nextYear = navyear
If nextMonth >12 Then
    nextMonth = 1
    nextYear = nextYear + 1
End If


dateCounter = 1
weekCount = 1

DateEnd = lastDate
DateBegin = firstDate

Weekday_Font = RSBODY("Weekday_Font")
Weekday_Font_Size = RSBODY("Weekday_Font_Size")
Weekday_Font_Color = RSBODY("Weekday_Font_Color")
Weekday_Background_Color = RSBODY("Weekday_Background_Color")
Date_Font = RSBODY("Date_Font")
Date_Font_Size = RSBODY("Date_Font_Size")
Date_Font_Color = RSBODY("Date_Font_Color")
Date_Background_Color = RSBODY("Date_Background_Color")
Event_Font = RSBODY("Event_Font")
Event_Font_Size = RSBODY("Event_Font_Size")
Event_Font_Color = RSBODY("Event_Font_Color")
Cell_Width = RSBODY("Cell_Width")
Cell_Height = RSBODY("Cell_Height")
Cell_Background_Color = RSBODY("Cell_Background_Color")
Border_Size = RSBODY("Border_Size")
Border_Color = RSBODY("Border_Color")
%>

<%=RSBODY("Header")%>

<table border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td align="center"> <table border="0" cellpadding="2" cellspacing="0" width="100%">
        <tr>
          <td align="left" valign="bottom"><font face="verdana" size="2"><b><font color="ffffff"><<</font><a href="default.asp?month=<%=lastMonth%>&year=<%=lastYear%>">
            <%If (RSBODY("Abbreviate_Months") = True) Then%>
            <%=MonthName(lastMonth, true)%>
            <%Else%>
            <%=MonthName(lastMonth)%>
            <%End If%>
            </a></b></font></td>
          <td align="center" valign="bottom"><font face="verdana" size="4"><b>
            <%If (RSBODY("Abbreviate_Months") = True) Then%>
          <font color="#FFFFFF"><%=MonthName(navMonth, true)%></font>
            <%Else%>
            <font color="#FFFFFF"><%=MonthName(navMonth)%></font>
            <%End If%>
            <font color="#FFFFFF">&nbsp;<%=navyear%></font></b></font></td>
          <td align="right" valign="bottom"><font face="verdana" size="2"><b><a href="default.asp?month=<%=nextMonth%>&year=<%=nextYear%>">
            <%If (RSBODY("Abbreviate_Months") = True) Then%>
            <%=MonthName(nextMonth, true)%>
            <%Else%>
            <%=MonthName(nextMonth)%>
            <%End If%>
            </a><font color="#FFFFFF">>></font></b></font></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td> <table border="0" cellpadding="0" cellspacing="0" align="center">
        <tr>
          <td bgcolor="<%=Border_Color%>"> <table border="0" cellpadding="2" cellspacing="<%=Border_Size%>">
              <tr>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  S&oslash;n
                  <%Else%>
                  S&oslash;ndag
                  <%End If%>
                  </b></font></td>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  Man
                  <%Else%>
                  Mandag
                  <%End If%>
                  </b></font></td>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  Tir
                  <%Else%>
                  Tirsdag
                  <%End If%>
                  </b></font></td>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  Ons
                  <%Else%>
                  Onsdag
                  <%End If%>
                  </b></font></td>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  Tor
                  <%Else%>
                  Torsdag
                  <%End If%>
                  </b></font></td>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  Fre
                  <%Else%>
                  Fredag
                  <%End If%>
                  </b></font></td>
                <td width="<%=Cell_Width%>" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
                  <%If (RSBODY("Abbreviate_Days") = True) Then%>
                  L&oslash;r
                  <%Else%>
                  L&oslash;rdag
                  <%End If%>
                  </b></font></td>
              </tr>
              <tr>
                <% Do while weekCount <= 7
dateSelect = navmonth & "/" & dateCounter & "/" & navyear %>
                <% If (weekCount < firstDay) OR (dateCounter > lastDate) Then %>
                <td height="<%=Cell_Height%>" bgcolor="<%=Cell_Background_Color%>"><img src="im/clear.gif" height="1" width="1"></td>
                <% else %>
                <td height="<%=Cell_Height%>" bgcolor="<%=Date_Background_Color%>" valign="top"><a href="date.asp?date=<%=dateSelect%>"><font face="<%=Date_Font%>" size="<%=Date_Font_Size%>" color="<%=Date_Font_Color%>"><b><%=dateCounter%></b></font><font face="<%=Event_Font%>" size="<%=Event_Font_Size%>" color="<%=Event_Font_Color%>">
                  <%
Set RSEVENT = Server.CreateObject("ADODB.RecordSet")
RSEVENT.Open "SELECT * FROM Events", Conn, 1, 3

Do while NOT RSEVENT.EOF
rsdate = RSEVENT("Date")
If (Day(rsdate) = dateCounter) AND (Month(rsdate) = CInt(navmonth)) AND (Year(rsdate) = CInt(navyear)) Then%>
                  <br>
                  <%If RSBODY("Event_Display") = True Then%>
                  <%=RSEVENT("Category")%>
                  <%Else%>
                  <%=RSEVENT("Event_Name")%>
                  <% End If

End If
RSEVENT.movenext
Loop
RSEVENT.close
%>
                  </font></a></td>
                <%
dateCounter = dateCounter + 1
end if

weekCount = weekCount + 1
Loop
weekCount = 1
%>
              </tr>
              <% Do while dateCounter <= lastDate %>
              <tr>
                <% Do while weekCount <= 7
dateSelect = navmonth & "/" & dateCounter & "/" & navyear %>
                <% If dateCounter > lastDate Then %>
                <td height="<%=Cell_Height%>" bgcolor="<%=Cell_Background_Color%>"><img src="im/clear.gif" height="1" width="1"></td>
                <% else %>
                <td height="<%=Cell_Height%>" bgcolor="<%=Date_Background_Color%>" valign="top"><a href="date.asp?date=<%=dateSelect%>"><font face="<%=Date_Font%>" size="<%=Date_Font_Size%>" color="<%=Date_Font_Color%>"><b><%=dateCounter%></b></font><font face="<%=Event_Font%>" size="<%=Event_Font_Size%>" color="<%=Event_Font_Color%>">
                  <%
Set RSEVENT = Server.CreateObject("ADODB.RecordSet")
RSEVENT.Open "SELECT * FROM Events", Conn, 1, 3
Do while NOT RSEVENT.EOF
rsdate = RSEVENT("Date")
If (Day(rsdate) = dateCounter) AND (Month(rsdate) = CInt(navmonth)) AND (Year(rsdate) = CInt(navyear)) Then%>
                  <br>
                  <%If RSBODY("Event_Display") = True Then%>
                  <%=RSEVENT("Category")%>
                  <%Else%>
                  <%=RSEVENT("Event_Name")%>
                  <% End If

End If
RSEVENT.movenext
Loop
RSEVENT.close
%>
                  </font></a></td>
                <%
dateCounter = dateCounter + 1
end if

weekCount = weekCount + 1
Loop
weekCount = 1
%>
              </tr>
              <% Loop %>
            </table></td>
        </tr>
      </table></td>
  </tr>

</table>
<p><%=RSBODY("Footer")%></p>
<p align="center">2005
  | <a href="default.asp?month=1&year=2005">Jan </a>| <a href="default.asp?month=2&year=2005">Feb</a> | <a href="default.asp?month=3&year=2005">Mar</a> | <a href="default.asp?month=4&year=2005">Apr</a> | <a href="default.asp?month=5&year=2005">Maj </a>| <a href="default.asp?month=6&year=2005">Jun </a>| <a href="default.asp?month=7&year=2005">Jul </a>| <a href="default.asp?month=8&year=2005">Aug </a>| <a href="default.asp?month=9&year=2005">Sep </a>| <a href="default.asp?month=10&year=2005">Okt </a>| <a href="default.asp?month=11&year=2005">Nov </a>| <a href="default.asp?month=12&year=2005">Dec </a>|</p>
<p align="center">2006 | <a href="default.asp?month=1&year=2006">Jan </a>| <a href="default.asp?month=2&year=2006">Feb</a> | <a href="default.asp?month=3&year=2006">Mar</a> | <a href="default.asp?month=4&year=2006">Apr</a> | <a href="default.asp?month=5&year=2006">Maj </a>| <a href="default.asp?month=6&year=2006">Jun </a>| <a href="default.asp?month=7&year=2006">Jul </a>| <a href="default.asp?month=8&year=2006">Aug </a>| <a href="default.asp?month=9&year=2006">Sep </a>| <a href="default.asp?month=10&year=2006">Okt </a>| <a href="default.asp?month=11&year=2006">Nov </a>| <a href="default.asp?month=12&year=2006">Dec </a>|</p>
</body>
</html>
<!--#include file="dsn2.asp"-->
Avatar billede dtc Nybegynder
06. juli 2005 - 14:20 #9
Og her er den for date.asp


<!--#include file="dsn.asp"-->
<!--#include file="body.asp"-->
<html>
<head>
<title><%=RSBODY("Page_Title")%></title>

<!--#include file="style.asp"-->

</head>
<body bgcolor="<%=RSBODY("Background_Color")%>" text="<%=RSBODY("Font_Color")%>" link="<%=RSBODY("Link_Color")%>" vlink="<%=RSBODY("Visited_Link_Color")%>" alink="<%=RSBODY("Active_Link_Color")%>">
<% Session.LCID = 1033 %>
<%

navmonth = request.querystring("month")
navyear = request.querystring("year")

If navmonth = "" Then
    navmonth = Month(Date)
End If

If navyear = "" Then
    navyear = Year(Date)
End If


firstday = Weekday(CDate(navmonth & "/" & 1 & "/" & navyear))


leapTestNumbers = navyear / 4
leapTest = (leapTestNumbers) - Round(leapTestNumbers)
If navmonth = 2 Then
    If leapTest <> 0 Then
        lastDate = 28
    Else
        lastDate = 29
    End If
ElseIf ((navmonth = 4) OR (navmonth = 6) OR (navmonth = 9) OR (navmonth = 11)) Then
    lastDate = 30
Else
    lastDate = 31
End If

lastMonth = navmonth - 1
lastYear = navyear
If lastMonth < 1 Then
    lastMonth = 12
    lastYear = lastYear - 1
End If

nextMonth = navmonth + 1
nextYear = navyear
If nextMonth >12 Then
    nextMonth = 1
    nextYear = nextYear + 1
End If


dateCounter = 1
weekCount = 1

DateEnd = lastDate
DateBegin = firstDate

Weekday_Font = RSBODY("Weekday_Font")
Weekday_Font_Size = RSBODY("Weekday_Font_Size")
Weekday_Font_Color = RSBODY("Weekday_Font_Color")
Weekday_Background_Color = RSBODY("Weekday_Background_Color")
Date_Font = RSBODY("Date_Font")
Date_Font_Size = RSBODY("Date_Font_Size")
Date_Font_Color = RSBODY("Date_Font_Color")
Date_Background_Color = RSBODY("Date_Background_Color")
Event_Font = RSBODY("Event_Font")
Event_Font_Size = RSBODY("Event_Font_Size")
Event_Font_Color = RSBODY("Event_Font_Color")
Cell_Width = RSBODY("Cell_Width")
Cell_Height = RSBODY("Cell_Height")
Cell_Background_Color = RSBODY("Cell_Background_Color")
Border_Size = RSBODY("Border_Size")
Border_Color = RSBODY("Border_Color")
%>
<%=RSBODY("Header")%>


<table border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td align="center"> <table border="0" cellpadding="0" cellspacing="0" align="center">
        <tr>
          <td bgcolor="<%=Border_Color%>"> <table border="0" cellpadding="2" cellspacing="<%=Border_Size%>">
<tr>
                <td width="300" align="center" bgcolor="<%=Weekday_Background_Color%>"><font face="<%=Weekday_Font%>" size="<%=Weekday_Font_Size%>" color="<%=Weekday_Font_Color%>"><b>
<%If (RSBODY("Abbreviate_Months") = True) Then%>
                  <%=MonthName(Month(request("date")), true)%>
                  <%Else%>
                  <%=MonthName(Month(request("date")))%>
                  <%End If%>
                  &nbsp;<%=Day(request("date"))%>,&nbsp;<%=Year(request("date"))%></b></font></td>
              </tr>
              <tr>
                <td width="300" align="center" background="../pagegraphics/back-table.jpg">
<table width="280" border="0" cellpadding="0" cellspacing="0">
                    <%
eventEmpty = True

Set RSEVENT = Server.CreateObject("ADODB.RecordSet")
RSEVENT.Open "SELECT * FROM Events ORDER BY Date", Conn, 1, 3
Do while NOT RSEVENT.EOF
rsdate = RSEVENT("Date")
If (Day(rsdate) = Day(request("date"))) AND (Month(rsdate) = CInt(Month(request("date")))) AND (Year(rsdate) = CInt(Year(request("date")))) Then
eventEmpty = False
%>
                    <tr>
                      <td height="20">&nbsp;</td>
                    </tr>
                    <tr>
                      <td><font face="<%=Event_Font%>" size="3" color="<%=Event_Font_Color%>"><b><%=RSEVENT("Event_Name")%></b></font></td>
                    </tr>
                    <tr>
                      <td><hr noshade></td>
                    </tr>
                    <% If (NOT isNull(RSEVENT("Location"))) Then %>
                    <tr>
                      <td><font face="<%=Event_Font%>" size="<%=Event_Font_Size%>" color="<%=RSBODY("Link_Color")%>">&nbsp;</font><font face="<%=Event_Font%>" size="<%=Event_Font_Size%>" color="<%=Event_Font_Color%>"><%=RSEVENT("Location")%></font></td>
                    </tr>
                    <%End If%>
                    <tr>
                      <td><font face="<%=Event_Font%>" size="<%=Event_Font_Size%>" color="<%=Event_Font_Color%>"><font color="ffffff"><%=RSEVENT("Description")%></font></font></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                    </tr>
                    <% End If
RSEVENT.movenext
Loop
RSEVENT.close
%>
                  </table>
                  <%
If (eventEmpty = True) Then%> <font face="<%=Event_Font%>" size="<%=Event_Font_Size%>" color="<%=Event_Font_Color%>">Der
                  er pt. ingen begivenheder for denne dag!</font> <%End If%> </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>

</table>
<br>
<center>
  <a href="http://www.a-vision.dk/kalender"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><<
  Tilbage til kalender</strong></font></a>
</center>
<%=RSBODY("Footer")%>
</body>
</html>
<!--#include file="dsn2.asp"-->
Avatar billede dtc Nybegynder
06. juli 2005 - 14:21 #10
Så er der jo yderligere 2 dokumenter i admin sektionen - add.asp + add2.asp shvor man oprettet selve eventen!
Avatar billede fennec Nybegynder
06. juli 2005 - 14:27 #11
Ok, det kommer vist til at tage lidt tid at finde problemet, og da jeg smutter til U2 koncert i morgen, kan jeg ikke love jeg får tid til at kikke på det før efter mandag :(
Avatar billede dtc Nybegynder
06. juli 2005 - 14:37 #12
ok.....det er bare i orden - GOD FORNØJELSE
Avatar billede fennec Nybegynder
11. juli 2005 - 08:28 #13
Har du fået det til at virke??
Avatar billede dtc Nybegynder
08. februar 2006 - 18:59 #14
lukker lige....
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester