1
diff -Nru3 ./gtimer-1.1.6/gtimer.1 ../build-tree.new/gtimer-1.1.6/gtimer.1
2
--- ./gtimer-1.1.6/gtimer.1 2003-03-21 09:45:07.000000000 -0800
3
+++ ../build-tree.new/gtimer-1.1.6/gtimer.1 2005-07-15 23:39:34.000000000 -0700
8
-[\f3\-midnight \f2offset\f1] [\f3\-nosplash] [\f3\-resume] [\f3\-start \f2task\f1]
9
+[\f3\-midnight \f2offset\f1] [\f3\-weekstart \f2day\f1] [\f3\-nosplash] [\f3\-resume] [\f3\-start \f2task\f1]
14
will not consider everything 3:59AM the previous day.
17
+.B \-weekstart \f2day\f3
18
+Specify which day of the week should be considered the beginning of the
19
+week when generating reports. \f2day\f3 should be a number between 0 and
20
+6, where 0 is Sunday. For example, the command
22
+.B gtimer -weekstart 1
24
+will use Monday as the first day of the week for all weekly reports. The
25
+default is 0 (Sunday).
29
Start timing any tasks that were still be timed when
31
diff -Nru3 ./gtimer-1.1.6/main.c ../build-tree.new/gtimer-1.1.6/main.c
32
--- ./gtimer-1.1.6/main.c 2005-07-15 23:39:40.000000000 -0700
33
+++ ../build-tree.new/gtimer-1.1.6/main.c 2005-07-15 23:32:09.000000000 -0700
35
* http://www.cknudsen.com/gtimer/
38
+ * 15-Jul-2005 Add -weekstart to configure the first day of the
39
+ * week. (Russ Allbery)
40
* 31-May-2005 When exiting, only change the window size
41
* configuration if gdk_window_get_size succeeds.
44
int config_toolbar_enabled = 1;
45
int config_animate_enabled = 1;
46
int config_autosave_interval = (60*15); /* 15 minutes */
47
+int config_start_of_week = 0;
50
char *config_file = NULL;
52
gettext ( "specify the midnight offset" ) );
53
printf ( "%-20s %s\n", "-start taskname",
54
gettext ( "start timing the specified task" ) );
55
+ printf ( "%-20s %s\n", "-weekstart N",
56
+ gettext ( "use N as the first day of weeks" ) );
60
@@ -3046,6 +3051,26 @@
61
config_midnight_offset = ( offset / 100 * 3600 ) + ( offset % 100 * 60 );
63
config_midnight_offset *= -1;
64
+ } else if ( strcmp ( argv[loop], "-weekstart" ) == 0 ) {
65
+ if ( ! argv[loop+1] ) {
66
+ fprintf ( stderr, "%s: -weekstart %s.\n",
67
+ gettext("Error"), gettext("requires an argument") );
70
+ for ( ptr = argv[++loop]; *ptr != '\0'; ptr++ ) {
71
+ if ( ! isdigit ( *ptr ) ) {
72
+ fprintf ( stderr, "%s: -weekstart %s (%s %s)\n",
73
+ gettext("Error"), gettext("requires a number"),
74
+ gettext("not"), argv[loop] );
78
+ config_start_of_week = atoi ( argv[loop] );
79
+ if ( config_start_of_week > 6 ) {
80
+ fprintf ( stderr, "%s -weekstart: %s\n",
81
+ gettext("Invalid day of week number for"), argv[loop] );
84
} else if ( strcmp ( argv[loop], "-start" ) == 0 ) {
86
matches[nmatches++] = argv[++loop];
87
diff -Nru3 ./gtimer-1.1.6/report.c ../build-tree.new/gtimer-1.1.6/report.c
88
--- ./gtimer-1.1.6/report.c 2005-07-15 23:39:40.000000000 -0700
89
+++ ../build-tree.new/gtimer-1.1.6/report.c 2005-07-15 23:26:40.000000000 -0700
91
* http://www.cknudsen.com/gtimer/
94
+ * 15-Jul-2005 Allow the start of the week to be configured.
96
* 15-Jul-2005 Honor the user's locale for weekday names.
97
* 17-Apr-2005 Added configurability of the browser. (Russ Allbery)
98
* 02-Jan-2004 Honor the user's locale for date display. (Colin
100
extern TaskData **visible_tasks;
101
extern int num_visible_tasks;
102
extern int config_midnight_offset;
103
+extern int config_start_of_week;
104
extern GtkWidget *main_window;
105
extern GdkPixmap *appicon2;
106
extern GdkPixmap *appicon2_mask;
108
strftime ( daystring, sizeof(daystring), "%x %a", tm );
110
for ( loop = 0; loop < num_seltasks; loop++ ) {
111
- if ( seltasks[loop]->week_start[0] == '\0' || tm->tm_wday == 0 )
112
+ if ( ( seltasks[loop]->week_start[0] == '\0' ) ||
113
+ ( tm->tm_wday == config_start_of_week ) )
114
strcpy ( seltasks[loop]->week_start, daystring );
116
entry = taskGetTimeEntry ( seltasks[loop]->taskdata->task,
120
if ( ( type == REPORT_TYPE_WEEKLY ) &&
121
- ( wday == 6 || is_last ) ) {
122
+ ( wday == ( ( config_start_of_week + 6 ) % 7 ) || is_last ) ) {
124
for ( loop = 0; loop < num_seltasks; loop++ ) {
125
if ( seltasks[loop]->weekly_total ||