Bug 201510

Summary: GtkCalendar starts on Saturday in POSIX
Product: [Fedora] Fedora Reporter: David Nečas <yeti>
Component: gtk2Assignee: Matthias Clasen <mclasen>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-28 06:06:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Nečas 2006-08-06 20:24:43 UTC
Description of problem:
In POSIX locale GtkCalendar starts weeks with Saturday.

Version-Release number of selected component (if applicable):
gtk2-2.8.20-1

How reproducible:
Always.

Steps to Reproduce:
1. Create calendar.c:

#include <gtk/gtk.h>

int
main(int argc,
     char *argv[])
{
    GtkWidget *window, *w;

    gtk_init(&argc, &argv);
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

    w = gtk_calendar_new();
    gtk_container_add(GTK_CONTAINER(window), w);

    gtk_widget_show_all(window);
    gtk_main();

    return 0;
}

2. Compile it

gcc $(pkg-config --cflags --libs gtk+-2.0) -o calendar calendar.c

3. Run it

LC_TIME=POSIX ./calendar
  
Actual results:
It shows a calendar with Saturday as the first day of the week.

Expected results:
I'm not sure if POSIX says anything about the first day of the week, anyway
Saturday is eccentric, so probably Sunday.

Comment 1 David Nečas 2006-08-10 21:14:32 UTC
The calculation in gtk_calendar_init() for POSIX goes:

first_weekday = 7
week_origin = 19971130
week_1stday = 0
priv->week_start = 6

I don't understand why priv->week_start is computed as it's computed I can't
tell anything more.

Comment 2 Matthias Clasen 2006-08-28 06:06:06 UTC
This is a bug in the glibc localedata, see
http://sources.redhat.com/bugzilla/show_bug.cgi?id=181