// Donated by Jesse Tayler <jtayler@tmade.com>
// Copyright (C) 1995 Jesse Tayler
// Use governed by the MiscKit license

#import "MiscClockViewExtensions.h"
#import <eoaccess/eoaccess.h>

@implementation MiscClockView(MiscClockViewExtensions)

- setTimeFromNSDate:(NSCalendarDate *)thedate
{
	int i;

	[self setMonth:(([thedate monthOfYear]) -1)];
	[self setWeekday:[thedate dayOfWeek]];
	i = [thedate hourOfDay];
	if (i > 12) {
		i = (i - 12);
		[self setMeridian:1];
	} else {
		[self setMeridian:0];
	}
	[self setHours:i];
	[self setMinutes:[thedate minuteOfHour]];
	[self setDate:[thedate dayOfMonth]];
	return self;
}

@end

