* Improved QML/JS.
[lichviet] / qml / DatePicker / component / DateReel.qml
index 8ae694b..bdc3360 100644 (file)
@@ -1,5 +1,7 @@
 import QtQuick 1.0
 
+import "../../LichViet/main.js" as Script
+
 Item {
     id: container
 
@@ -149,12 +151,12 @@ Item {
 
         Component.onCompleted: {
             appends()
-            day.index = screen.curDay - 1
-            end = LC.calDays(month.index+1,year.index+1900);
+            day.index = Script.curDay - 1
+            end = Script.calDaysX(month.index+1,year.index+1900);
         }
 
         function reset(){
-            var howmanydays =  LC.calDays(month.index+1,year.index+1900);
+            var howmanydays =  Script.calDaysX(month.index+1,year.index+1900);
             end = howmanydays;
 
             if (day.index+1 < days.start) day.index = days.start-1;
@@ -171,7 +173,7 @@ Item {
         }
 
         function change(){
-           day.index = screen.curDay-1;
+           day.index = Script.curDay-1;
         }
     }
 
@@ -184,11 +186,11 @@ Item {
                 else
                    append({number:j})
             }
-            month.index = screen.curMonth - 1
+            month.index = Script.curMonth - 1
         }
 
         function change(){
-             month.index = screen.curMonth - 1;
+             month.index = Script.curMonth - 1;
         }
     }
 
@@ -198,26 +200,26 @@ Item {
             for(var i=1900;i<2099;i++){
                 append({number:i})
             }
-            year.index = screen.curYear - 1900
+            year.index = Script.curYear - 1900
         }
 
         function change(){
-              year.index = screen.curYear - 1900
+              year.index = Script.curYear - 1900
         }
     }
 
     function day_reset(){
-         datePicker.mDay = screen.curDay
+         datePicker.mDay = Script.curDay
         days.change()
     }
 
     function month_reset(){
-                 datePicker.mMonth = screen.curMonth
+                 datePicker.mMonth = Script.curMonth
         months.change()
     }
 
     function year_reset(){
-        datePicker.mYear = screen.curYear
+        datePicker.mYear = Script.curYear
         years.change()
     }