//
//  DatePickerViewController.m
//  Pickers
//
//  Created by Jeff LaMarche on 7/7/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "DatePickerViewController.h"


@implementation DatePickerViewController
@synthesize datePicker;

-(IBAction)buttonPressed:(id)sender
{
	NSLog(@"Tlacitko stisknuto");
	NSDate *selected = [datePicker date];
	NSString *message = [[NSString alloc] initWithFormat:@"Datum a cas, ktere jste vybrali je: %@", selected];
	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Vybrane datum a cas" message:message delegate:nil cancelButtonTitle:@"Ano, v poradku." otherButtonTitles:nil];
	[alert show];
	[alert release];
	[message release];
						
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
	if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
		// Initialization code
	}
	return self;
}


- (void)viewDidLoad {
	NSDate *now = [NSDate date];
	[datePicker setDate:now animated:YES];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	// Return YES for supported orientations
	return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


- (void)didReceiveMemoryWarning {
	[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
	// Release anything that's not essential, such as cached data
}


- (void)dealloc {
	[datePicker release];
	[super dealloc];
}


@end
