Index: trunk/Cocoa/Pester/Source/PSAlarm.h
===================================================================
--- trunk/Cocoa/Pester/Source/PSAlarm.h	(revision 607)
+++ trunk/Cocoa/Pester/Source/PSAlarm.h	(revision 608)
@@ -48,5 +48,7 @@
 
 - (NSCalendarDate *)date;
+- (NSDate *)midnightOnDate;
 - (NSDate *)time;
+- (int)daysFromToday;
 - (NSTimeInterval)interval;
 - (NSTimeInterval)timeRemaining;
Index: trunk/Cocoa/Pester/Source/PSAlarm.m
===================================================================
--- trunk/Cocoa/Pester/Source/PSAlarm.m	(revision 607)
+++ trunk/Cocoa/Pester/Source/PSAlarm.m	(revision 608)
@@ -29,4 +29,11 @@
 
 static NSDateFormatter *dateFormatter, *shortDateFormatter, *timeFormatter;
+
+static NSCalendar *gregorianCalendar;
+
+static NSDate *midnightOnDate(NSDate *date) {
+    return [gregorianCalendar dateFromComponents: 
+	    [gregorianCalendar components: NSMonthCalendarUnit|NSDayCalendarUnit|NSYearCalendarUnit fromDate: date]];
+}
 
 @implementation PSAlarm
@@ -46,4 +53,5 @@
     [timeFormatter setTimeStyle: NSDateFormatterMediumStyle];
     [timeFormatter setDateStyle: NSDateFormatterNoStyle];
+    gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
 }
 
@@ -246,4 +254,11 @@
 }
 
+- (NSDate *)midnightOnDate;
+{
+    if (alarmType == PSAlarmInterval) [self _setDateFromInterval];
+    
+    return midnightOnDate(alarmDate);
+}
+
 - (NSDate *)time;
 {
@@ -251,8 +266,13 @@
     if (alarmType == PSAlarmInterval) [self _setDateFromInterval];
 
-    NSCalendar *calendar = [NSCalendar currentCalendar];
-
-    return [calendar dateFromComponents: 
-	    [calendar components: NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate: alarmDate]];
+    return [gregorianCalendar dateFromComponents: 
+	    [gregorianCalendar components: NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate: alarmDate]];
+}
+
+- (int)daysFromToday;
+{
+    if (alarmType == PSAlarmInterval) [self _setDateFromInterval];
+    
+    return [[gregorianCalendar components: NSDayCalendarUnit fromDate: midnightOnDate([NSDate date]) toDate: alarmDate options: 0] day];
 }
 
Index: trunk/Cocoa/Pester/Source/PSAlarmSetController.m
===================================================================
--- trunk/Cocoa/Pester/Source/PSAlarmSetController.m	(revision 607)
+++ trunk/Cocoa/Pester/Source/PSAlarmSetController.m	(revision 608)
@@ -165,21 +165,35 @@
 {
     // NSLog(@"updateDateDisplay: %@", sender);
-    if ([alarm isValid]) {
-        [self setStatus: [NSString stringWithFormat: @"Alarm will be set for %@\non %@.", [alarm timeString], [alarm dateString]]];
-        [setButton setEnabled: YES];
-        if (updateTimer == nil || ![updateTimer isValid]) {
-            // XXX this logic (and the timer) should really go into PSAlarm, to send notifications for status updates instead.  Timer starts when people are watching, stops when people aren't.
-            // NSLog(@"setting timer");
-            if (isInterval) {
-                updateTimer = [NSTimer scheduledTimerWithTimeInterval: 1 target: self selector: @selector(updateDateDisplay:) userInfo: nil repeats: YES];
-            } else {
-                updateTimer = [NSTimer scheduledTimerWithTimeInterval: [alarm interval] target: self selector: @selector(updateDateDisplay:) userInfo: nil repeats: NO];
-            }
-            [updateTimer retain];
-        }
-    } else {
-        [setButton setEnabled: NO];
-        [self setStatus: [alarm invalidMessage]];
-        [self _stopUpdateTimer];
+    if (![alarm isValid]) {
+	[setButton setEnabled: NO];
+	[self setStatus: [alarm invalidMessage]];
+	[self _stopUpdateTimer];
+	return;
+    }
+    
+    const int day = 60 * 60 * 24;
+    int daysUntilAlarm = [alarm daysFromToday];
+    NSString *onString;
+    switch (daysUntilAlarm) {
+	case 0: onString = @"today,"; break;
+	case 1: onString = @"tomorrow,"; break;
+	default: onString = @"on";
+    }
+    
+    [self setStatus: [NSString stringWithFormat: @"Alarm will be set for %@\n%@ %@.", [alarm timeString], onString, [alarm dateString]]];
+    [setButton setEnabled: YES];
+    if (updateTimer == nil || ![updateTimer isValid]) {
+	// XXX this logic (and the timer) should really go into PSAlarm, to send notifications for status updates instead.  Timer starts when people are watching, stops when people aren't.
+	// NSLog(@"setting timer");
+	if (isInterval) {
+	    updateTimer = [NSTimer scheduledTimerWithTimeInterval: 1 target: self selector: @selector(updateDateDisplay:) userInfo: nil repeats: YES];
+	} else {
+	    // XXX time/time zone change
+	    NSTimeInterval interval = [alarm interval];
+	    if (daysUntilAlarm < 2 && interval > day)
+		interval = [[alarm midnightOnDate] timeIntervalSinceNow];
+	    updateTimer = [NSTimer scheduledTimerWithTimeInterval: interval target: self selector: @selector(updateDateDisplay:) userInfo: nil repeats: NO];
+	}
+	[updateTimer retain];
     }
 }
