Update 0.5.10

Arne Rantzen [08-09-14 - 23:04]
Update 0.5.10

Fixed English week days names
Fixed the wrong real date day names
Filename
data/time.lua
data/view.lua
local/en.lua
diff --git a/data/time.lua b/data/time.lua
index 44c5f8f..dfadb5e 100644
--- a/data/time.lua
+++ b/data/time.lua
@@ -179,4 +179,66 @@ function tm.GetFakeLoreDate()
     local _, _, day = tm.GetLoreDate()

     return year, tonumber(month), day
+end
+
+local tmpWD = {
+    day = 0,
+    month = 0,
+    yearShort = 0,
+    weekDay = 0,
+}
+
+function tm.GetRealWeekDay(day, month, yearShort)
+    -- Algorithm will only run if not run already at the current day
+    if tmpWD.day ~= day or tmpWD.month ~= month or tmpWD.yearShort ~= yearShort then
+        local m = {
+            [1] = 31,
+            [2] = 28,
+            [3] = 31,
+            [4] = 30,
+            [5] = 31,
+            [6] = 30,
+            [7] = 31,
+            [8] = 31,
+            [9] = 30,
+            [10] = 31,
+            [11] = 30,
+            [12] = 31,
+        }
+
+        local dd = 31
+        local mm = 3
+        local yy = 14
+
+        local x = 0
+
+        while dd < day or mm < month or yy < yearShort do
+            if (yy % 4) == 0 then
+                m[2] = 29
+            else
+                m[2] = 28
+            end
+
+            if dd + 1 > m[mm] then
+                if mm + 1 > 12 then
+                    mm = 1
+                    yy = yy + 1
+                else
+                    mm = mm + 1
+                    dd = 1
+                end
+            else
+                dd = dd + 1
+            end
+
+            x = x + 1
+        end
+
+        tmpWD.weekDay = (x % 7) + 1
+        tmpWD.day = day
+        tmpWD.month = month
+        tmpWD.yearShort = yearShort
+    end
+
+    return tmpWD.weekDay
 end
\ No newline at end of file
diff --git a/data/view.lua b/data/view.lua
index 31b3530..7dc565b 100644
--- a/data/view.lua
+++ b/data/view.lua
@@ -118,7 +118,7 @@ function vi.ParseFormat(year, month, day, hour, minute, second, isLore)
         if cl.st.ShowDate() then
             yearShort = year - 2000
             monthName = locR.months[month]
-            dayName = locR.week[(day % 7) + 1]
+            dayName = locR.week[cl.tm.GetRealWeekDay(day, month, yearShort)]
         end
     end

diff --git a/local/en.lua b/local/en.lua
index 506650c..5bb9552 100644
--- a/local/en.lua
+++ b/local/en.lua
@@ -225,9 +225,9 @@ cl.ln = {
             real = {
                 week = {
                     [1] = "Monday",
-                    [2] = "Thusday",
-                    [3] = "Thirsday",
-                    [4] = "Thutersday",
+                    [2] = "Tuesday",
+                    [3] = "Wednesday",
+                    [4] = "Thursday",
                     [5] = "Friday",
                     [6] = "Saturday",
                     [7] = "Sunday",