--- gnome-panel-2.24.1/applets/clock/clock.c	2008-10-22 03:16:11.000000000 -0600
+++ gnome-panel-2.24.1/applets/clock/clock.c	2009-09-01 19:43:27.227162402 -0600
@@ -98,6 +98,8 @@
 	{ CLOCK_FORMAT_UNIX,     "unix"     },
 	{ CLOCK_FORMAT_INTERNET, "internet" },
 	{ CLOCK_FORMAT_CUSTOM,   "custom"   },
+        { CLOCK_FORMAT_FUZZY_HOUR,    "fuzzy-hour"    },
+        { CLOCK_FORMAT_FUZZY_DAY,    "fuzzy-day"    },
 	{ 0, NULL }
 };
 
@@ -330,7 +332,9 @@
 		    (unsigned int)get_itime (cd->current_time)) {
 			update_clock (cd);
 		} else if ((cd->format == CLOCK_FORMAT_12 ||
-			    cd->format == CLOCK_FORMAT_24) &&
+			    cd->format == CLOCK_FORMAT_24 ||
+                            cd->format == CLOCK_FORMAT_FUZZY_HOUR || 
+                            cd->format == CLOCK_FORMAT_FUZZY_DAY) &&
 			   new_time / 60 != cd->current_time / 60) {
 			update_clock (cd);
 		}
@@ -423,14 +427,19 @@
 	else
 		time_format = cd->showseconds ? _("%H:%M:%S") : _("%H:%M");
 
-	if (!safe) {
-		/* FIXME: we need this for bug #410169 in pango. We'll be able
-		 * to remove this at a later stage. */
-		time_gravity_format = g_strdup_printf ("<span gravity=\"south\">%s</span>",
-						       time_format);
-	} else {
-		time_gravity_format = g_strdup (time_format);
-	}
+        if (cd->format == CLOCK_FORMAT_FUZZY_HOUR || cd->format == CLOCK_FORMAT_FUZZY_DAY)
+                time_gravity_format = g_strdup("");
+        else
+        {
+        	if (!safe) {
+        		/* FIXME: we need this for bug #410169 in pango. We'll be able
+        		 * to remove this at a later stage. */
+        		time_gravity_format = g_strdup_printf ("<span gravity=\"south\">%s</span>",
+        						       time_format);
+        	} else {
+        		time_gravity_format = g_strdup (time_format);
+        	}
+        }
 
 	if (!cd->showdate)
 		clock_format = g_strdup (time_gravity_format);
@@ -553,6 +562,190 @@
 		g_free (timeformat);
 
 		utf8 = g_locale_to_utf8 (hour, -1, NULL, NULL, NULL);
+        } else if (cd->format == CLOCK_FORMAT_FUZZY_HOUR) {
+                if (strftime (hour, sizeof (hour), cd->timeformat, tm) <= 0)
+			strcpy (hour, "");
+
+                utf8 = malloc(100*sizeof(char));
+                strcpy(utf8, hour);
+
+                if (tm->tm_min > 52 || tm->tm_min < 8)
+                {
+                        if (tm->tm_min > 52)
+                                tm->tm_hour++;
+
+                        switch (tm->tm_hour)
+                        {
+                                case 0:
+                                        strcat(utf8, "Midnight");
+                                        break;
+                                case 12:
+                                        strcat(utf8, "Noon");
+                                break;
+                                case 1:
+                                case 13:
+                                        strcat(utf8, "One o'clock");
+                                        break;
+                                case 2:
+                                case 14:
+                                        strcat(utf8, "Two o'clock");
+                                        break;
+                                case 3:
+                                case 15:
+                                        strcat(utf8, "Three o'clock");
+                                        break;
+                                case 4:
+                                case 16:
+                                        strcat(utf8, "Four o'clock");
+                                        break;
+                                case 5:
+                                case 17:
+                                        strcat(utf8, "Five o'clock");
+                                        break;
+                                case 6:
+                                case 18:
+                                        strcat(utf8, "Six o'clock");
+                                        break;
+                                case 7:
+                                case 19:
+                                        strcat(utf8, "Seven o'clock");
+                                        break;
+                                case 8:
+                                case 20:
+                                        strcat(utf8, "Eight o'clock");
+                                        break;
+                                case 9:
+                                case 21:
+                                        strcat(utf8, "Nine o'clock");
+                                        break;
+                                case 10:
+                                case 22:
+                                        strcat(utf8, "Ten o'clock");
+                                        break;
+                                case 11:
+                                case 23:
+                                        strcat(utf8, "Eleven o'clock");
+                                        break;
+                        }
+                }
+                else
+                {
+                        if (tm->tm_min > 7 && tm->tm_min < 23)
+                        {
+                                strcat(utf8, "Quarter past ");
+                        }
+                        if (tm->tm_min > 22 && tm->tm_min < 38)
+                        {
+                                strcat(utf8, "Half past ");
+                        }
+                        if (tm->tm_min > 37 && tm->tm_min < 53)
+                        {
+                                strcat(utf8, "Quarter to ");
+                                tm->tm_hour = (tm->tm_hour+1) % 24;
+                        }
+        
+                        switch (tm->tm_hour)
+                        {
+                                case 0:
+                                        strcat(utf8, "midnight");
+                                        break;
+                                case 12:
+                                        strcat(utf8, "noon");
+                                break;
+                                case 1:
+                                case 13:
+                                        strcat(utf8, "one");
+                                        break;
+                                case 2:
+                                case 14:
+                                        strcat(utf8, "two");
+                                        break;
+                                case 3:
+                                case 15:
+                                        strcat(utf8, "three");
+                                        break;
+                                case 4:
+                                case 16:
+                                        strcat(utf8, "four");
+                                        break;
+                                case 5:
+                                case 17:
+                                        strcat(utf8, "five");
+                                        break;
+                                case 6:
+                                case 18:
+                                        strcat(utf8, "six");
+                                        break;
+                                case 7:
+                                case 19:
+                                        strcat(utf8, "seven");
+                                        break;
+                                case 8:
+                                case 20:
+                                        strcat(utf8, "eight");
+                                        break;
+                                case 9:
+                                case 21:
+                                        strcat(utf8, "nine");
+                                        break;
+                                case 10:
+                                case 22:
+                                        strcat(utf8, "ten");
+                                        break;
+                                case 11:
+                                case 23:
+                                        strcat(utf8, "eleven");
+                                        break;
+                        }
+                }
+        } else if (cd->format == CLOCK_FORMAT_FUZZY_DAY) {
+                if (strftime (hour, sizeof (hour), cd->timeformat, tm) <= 0)
+			strcpy (hour, "");
+
+                utf8 = malloc(100*sizeof(char));
+                strcpy(utf8, hour);
+
+                switch (tm->tm_hour)
+                {
+                        case 23:
+                        case 0:
+                        case 1:
+                        case 2:
+                                strcat(utf8, "Late night");
+                                break;
+                        case 3:
+                        case 4:
+                        case 5:
+                        case 6:
+                        case 7:
+                                strcat(utf8, "Early morning");
+                                break;
+                        case 8:
+                        case 9:
+                        case 10:
+                                strcat(utf8, "Morning");
+                                break;
+                        case 11:
+                        case 12:
+                        case 13:
+                                strcat(utf8, "Mid-day");
+                                break;
+                        case 14:
+                        case 15:
+                        case 16:
+                                strcat(utf8, "Afternoon");
+                                break;
+                        case 17:
+                        case 18:
+                        case 19:
+                                strcat(utf8, "Evening");
+                                break;
+                        case 20:
+                        case 21:
+                        case 22:
+                                strcat(utf8, "Night");
+                                break;
+                } 
 	} else {
 		if (strftime (hour, sizeof (hour), cd->timeformat, tm) <= 0)
 			strcpy (hour, "???");
@@ -3344,16 +3537,32 @@
 }
 
 static void
-set_12hr_format_radio_cb (GtkWidget *widget, ClockData *cd)
+set_12hr_24hr_fuzzy_format_radio_cb (GtkWidget *widget, ClockData *cd)
 {
+        GtkWidget *radio_12hr;
+        GtkWidget *radio_24hr;
+        GtkWidget *radio_fuzzyhr;
+        GtkWidget *radio_fuzzyday;
+	
+        /* Set the 12 hour / 24 hour widget */
+        radio_12hr     = glade_xml_get_widget (cd->glade_xml, "12hr_radio");
+        radio_24hr     = glade_xml_get_widget (cd->glade_xml, "24hr_radio");
+        radio_fuzzyhr  = glade_xml_get_widget (cd->glade_xml, "fuzzyhr_radio");
+        radio_fuzzyday = glade_xml_get_widget (cd->glade_xml, "fuzzyday_radio");
+
 	const gchar *val;
         ClockFormat format;
 
-	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_12hr)))
                 format = CLOCK_FORMAT_12;
+        else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_fuzzyhr)))
+                format = CLOCK_FORMAT_FUZZY_HOUR;
+        else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_fuzzyday)))
+                format = CLOCK_FORMAT_FUZZY_DAY;
         else
                 format = CLOCK_FORMAT_24;
 
+
         val = gconf_enum_to_string (format_type_enum_map, format);
 
 	panel_applet_gconf_set_string (PANEL_APPLET (cd->applet),
@@ -3429,25 +3638,46 @@
 
         GtkWidget *radio_12hr;
         GtkWidget *radio_24hr;
+        GtkWidget *radio_fuzzyhr;
+        GtkWidget *radio_fuzzyday;
 	GtkWidget *widget;
 	GtkCellRenderer *renderer;
         GtkTreeViewColumn *col;
 	GtkListStore *store;
         int i;
 
-	/* Set the 12 hour / 24 hour widget */
-        radio_12hr = glade_xml_get_widget (cd->glade_xml, "12hr_radio");
-        radio_24hr = glade_xml_get_widget (cd->glade_xml, "24hr_radio");
-
-        if (cd->format == CLOCK_FORMAT_12)
-                widget = radio_12hr;
-        else
-                widget = radio_24hr;
+	/* Set the 12 hour / 24 hour / fuzzy widget */
+        radio_12hr     = glade_xml_get_widget (cd->glade_xml, "12hr_radio");
+        radio_24hr     = glade_xml_get_widget (cd->glade_xml, "24hr_radio");
+        radio_fuzzyhr  = glade_xml_get_widget (cd->glade_xml, "fuzzyhr_radio");
+        radio_fuzzyday = glade_xml_get_widget (cd->glade_xml, "fuzzyday_radio");
+
+        switch (cd->format)
+        {
+                case CLOCK_FORMAT_12:
+                        widget = radio_12hr;
+                        break;
+                case CLOCK_FORMAT_FUZZY_HOUR:
+                        widget = radio_fuzzyhr;
+                        break;
+                case CLOCK_FORMAT_FUZZY_DAY:
+                        widget = radio_fuzzyday;
+                        break;
+                default:
+                        widget = radio_24hr;
+                        break;
+        }
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
 
 	g_signal_connect (radio_12hr, "toggled",
-			  G_CALLBACK (set_12hr_format_radio_cb), cd);
+			  G_CALLBACK (set_12hr_24hr_fuzzy_format_radio_cb), cd);
+	g_signal_connect (radio_24hr, "toggled",
+			  G_CALLBACK (set_12hr_24hr_fuzzy_format_radio_cb), cd);
+	g_signal_connect (radio_fuzzyhr, "toggled",
+			  G_CALLBACK (set_12hr_24hr_fuzzy_format_radio_cb), cd);
+	g_signal_connect (radio_fuzzyday, "toggled",
+			  G_CALLBACK (set_12hr_24hr_fuzzy_format_radio_cb), cd);
 
 	/* Set the "Show Date" checkbox */
 	widget = glade_xml_get_widget (cd->glade_xml, "date_check");
--- gnome-panel-2.24.1/applets/clock/clock.glade	2008-10-22 03:16:11.000000000 -0600
+++ gnome-panel-2.24.1-new/applets/clock/clock.glade	2009-08-28 00:54:40.799733530 -0600
@@ -185,6 +185,46 @@
 			      <property name="fill">False</property>
 			    </packing>
 			  </child>
+
+			  <child>
+			    <widget class="GtkRadioButton" id="fuzzyhr_radio">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">_Fuzzy hour format</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			      <property name="group">12hr_radio</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkRadioButton" id="fuzzyday_radio">
+			      <property name="visible">True</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Fu_zzy day format</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			      <property name="group">12hr_radio</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
 			</widget>
 		      </child>
 		    </widget>
--- gnome-panel-2.24.1/applets/clock/clock.schemas.in	2008-10-22 03:16:11.000000000 -0600
+++ gnome-panel-2.24.1-new/applets/clock/clock.schemas.in	2009-08-28 01:42:03.347732410 -0600
@@ -23,8 +23,8 @@
           <short>Hour format</short>
           <long>
             This key specifies the hour format used by the clock applet.
-            Possible values are "12-hour", "24-hour", "internet", "unix" and
-	    "custom".
+            Possible values are "12-hour", "24-hour", "internet", "unix",
+	    "custom", "fuzzy-hour" and "fuzzy-day".
             If set to "internet", the clock will display Internet time.
             The Internet time system divides the day into 1000 ".beats". There
             are no time zones in this system, so time is the same all over the
--- gnome-panel-2.24.1/applets/clock/clock-typebuiltins.c	2008-10-22 03:48:10.000000000 -0600
+++ gnome-panel-2.24.1-new/applets/clock/clock-typebuiltins.c	2009-08-28 01:33:37.984748256 -0600
@@ -14,6 +14,8 @@
   { CLOCK_FORMAT_UNIX, "CLOCK_FORMAT_UNIX", "unix" },
   { CLOCK_FORMAT_INTERNET, "CLOCK_FORMAT_INTERNET", "internet" },
   { CLOCK_FORMAT_CUSTOM, "CLOCK_FORMAT_CUSTOM", "custom" },
+  { CLOCK_FORMAT_FUZZY_HOUR, "CLOCK_FORMAT_FUZZY_HOUR", "fuzzy-hour" },
+  { CLOCK_FORMAT_FUZZY_DAY, "CLOCK_FORMAT_FUZZY_DAY", "fuzzy-day" },
   { 0, NULL, NULL }
 };
 
--- gnome-panel-2.24.1/applets/clock/clock-utils.h	2008-10-22 03:16:11.000000000 -0600
+++ gnome-panel-2.24.1-new/applets/clock/clock-utils.h	2009-08-28 00:37:19.795732155 -0600
@@ -38,7 +38,9 @@
 	CLOCK_FORMAT_24,
 	CLOCK_FORMAT_UNIX,
 	CLOCK_FORMAT_INTERNET,
-	CLOCK_FORMAT_CUSTOM
+	CLOCK_FORMAT_CUSTOM,
+	CLOCK_FORMAT_FUZZY_HOUR,
+	CLOCK_FORMAT_FUZZY_DAY
 } ClockFormat;
 
 ClockFormat clock_locale_format (void);
