2
* Copyright (C) 2013-2014 Canonical Ltd
4
* This file is part of Ubuntu Calendar App
6
* Ubuntu Calendar App is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 3 as
8
* published by the Free Software Foundation.
10
* Ubuntu Calendar App is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
.import QtOrganizer 5.0 as QtPim
22
var recurrenceLabel = getRecurrenceLabels();
23
var weekLabel = getWeekLabels();
24
// It contains multiple weekly entries to handle following occurence
25
//1.Every Weekday (Monday to Friday
26
//2.Every Monday, Wednesday and Friday
27
//3.Every Tuesday and Thursday
29
var recurrenceValue = [ QtPim.RecurrenceRule.Invalid,
30
QtPim.RecurrenceRule.Daily,
31
QtPim.RecurrenceRule.Weekly,
32
QtPim.RecurrenceRule.Weekly,
33
QtPim.RecurrenceRule.Weekly,
34
QtPim.RecurrenceRule.Weekly,
35
QtPim.RecurrenceRule.Monthly,
36
QtPim.RecurrenceRule.Yearly];
38
function getRecurrenceLabels() {
39
var component = Qt.createComponent(Qt.resolvedUrl("RecurrenceLabelDefines.qml"));
40
var object = component.createObject(Qt.application);
41
return object.recurrenceLabel;
44
function getWeekLabels(){
45
var object = Qt.createQmlObject('\
47
import Ubuntu.Components 1.1;\
49
property var weekLabel:[Qt.locale().dayName(7,Locale.NarrowFormat),\
50
Qt.locale().dayName(1,Locale.NarrowFormat),\
51
Qt.locale().dayName(2,Locale.NarrowFormat),\
52
Qt.locale().dayName(3,Locale.NarrowFormat),\
53
Qt.locale().dayName(4,Locale.NarrowFormat),\
54
Qt.locale().dayName(5,Locale.NarrowFormat),\
55
Qt.locale().dayName(6,Locale.NarrowFormat)];}', Qt.application, 'weekLabelObj');
56
return object.weekLabel;