Skip to content

Instantly share code, notes, and snippets.

@tingham
Created May 2, 2010 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tingham/386874 to your computer and use it in GitHub Desktop.
Save tingham/386874 to your computer and use it in GitHub Desktop.
@implementation TableDateView : CPView
{
CPTextField labelView;
CPDate myDate;
}
- (void)setObjectValue:(id)value {
if( value &&
!myDate ){
myDate = [[CPDate alloc] initWithString:[CPString stringWithFormat:@"%@ -0400",value]];
labelView = [[CPTextField alloc] initWithFrame:CGRectMake(0,0,200,22)];
[labelView setStringValue:[CPString stringWithFormat:@"%d/%d/%d",myDate.getMonth()+1,myDate.getDate(),myDate.getFullYear()]];
[labelView setFont:[CPFont systemFontOfSize:12.0]];
[self addSubview:labelView];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment