2
* kalocale.h - miscellaneous locale functions
4
* Copyright © 2004-2009 by David Jarvie <djarvie@kde.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
/** Return the first day of the week for the user's locale.
31
* Reply = 1 (Mon) .. 7 (Sun).
33
int localeFirstDayOfWeek();
35
/** Return the week day name (Monday = 1). */
36
QString weekDayName(int day, const KLocale*);
38
/* Given a standard KDE day number, return the day number in the week for the user's locale.
39
* Standard day number = 1 (Mon) .. 7 (Sun)
40
* Locale day number in week = 0 .. 6
42
inline int weekDay_to_localeDayInWeek(int weekDay) { return (weekDay + 7 - localeFirstDayOfWeek()) % 7; }
44
/* Given a day number in the week for the user's locale, return the standard KDE day number.
46
* Standard day number = 1 (Mon) .. 7 (Sun)
48
inline int localeDayInWeek_to_weekDay(int index) { return (index + localeFirstDayOfWeek() - 1) % 7 + 1; }
50
uint defaultWorkDays();