rollback to qtquick 1.0 to compatible with qtlib 4.7 maemo5 fremantle pr 1.3
[lichviet] / qml / LichViet / FullMonth.qml
index ef05b52..12f7be4 100644 (file)
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
 
-import QtQuick 1.1
+import QtQuick 1.0
 
 import "Themes.js" as Themes
 import "main.js" as Script
@@ -103,7 +103,7 @@ Item{
                 horizontalAlignment: Text.AlignLeft
 
                 text: model ? model.day : ""
-                color: model ? model.inmonth ? (model.current ? "red" : model.inholiday ? theme_manager.theme.markdate.holidays : "black") : "grey" : "red"
+                color: model ? model.inmonth ? (model.current ? "grey" : model.inholiday ? theme_manager.theme.markdate.holidays : "black") : "grey" : "red"
                 font.pointSize: parent.width > parent.height ? parent.width ? parent.width / 6 : 1 : parent.width / 4
                 font.bold: true
             }
@@ -117,7 +117,7 @@ Item{
                 horizontalAlignment: Text.AlignBottom
 
                 text: model ? model.lunar_day : ""
-                color: model ? model.inmonth ? (model.current ? "red" : "#700070") : "grey" : "red"
+                color: model ? model.inmonth ? (model.current ? "white" : "#700070") : "grey" : "red"
                 font.pointSize: parent.width > parent.height ? parent.width ? parent.width / 8 : 1 : parent.width / 5
             }
 
@@ -309,7 +309,7 @@ Item{
 
         var firstdayofthemonthyear = Script.getLunarDate(1,m_month,m_year).jd;
         var startfrom = (firstdayofthemonthyear+1)%7;
-        var daysofthemonthyear = Script.calDays(m_month,m_year);
+        var daysofthemonthyear = Script.calDaysX(m_month,m_year);
         var j=1;
         var totalslot = 42;
 
@@ -362,15 +362,16 @@ Item{
     }
 
     function get_prevmonth(startfrom){
-        var cMonth=m_month;
+        var cMonth=m_month-1;
         var cYear=m_year;
         var pmonth = [];
-        if (cMonth == 1){
-            cMonth = 12
+
+        if (cMonth === 0){
+            cMonth = 12;
             cYear--;
-        }else
-            cMonth--;
-         var daysofthemonthyear = Script.calDays(cMonth,cYear);
+        }
+
+         var daysofthemonthyear = Script.calDaysX(cMonth,cYear);
         for (var i=daysofthemonthyear;i>daysofthemonthyear-startfrom;i--){
             var lunarcl = Script.getLunarDate(i,cMonth,cYear)
             pmonth.push({duong:i, am:lunarcl.day, month:cMonth, year:cYear})
@@ -379,14 +380,14 @@ Item{
     }
 
     function get_nextmonth(startfrom){
-        var cMonth=m_month;
+        var cMonth=m_month+1;
         var cYear=m_year;
          var pmonth = [];
-        if (cMonth==12){
-            cMonth = 1;
+
+        if (cMonth === 13){
+            cMonth=1;
             cYear++;
-        }else
-            cMonth++;
+        }
 
         for (var i=1;i<=startfrom;i++){
           var lunarcl = Script.getLunarDate(i,cMonth,cYear)