diff options
author | stuconnolly <stuart02@gmail.com> | 2009-03-31 22:20:10 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-03-31 22:20:10 +0000 |
commit | b60f82aa30dce5c875a30116c7e264537fedcf52 (patch) | |
tree | d2f44f06c3fc8815739523651320aec8b7c916aa /Source | |
parent | 0574a0b340b92ff5038bc4340b283c13ce513c1c (diff) | |
download | sequelpro-b60f82aa30dce5c875a30116c7e264537fedcf52.tar.gz sequelpro-b60f82aa30dce5c875a30116c7e264537fedcf52.tar.bz2 sequelpro-b60f82aa30dce5c875a30116c7e264537fedcf52.zip |
For some reason the display of the table create and update dates in the status view were broken, so changed it to use the same method used by the table info pane.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/TableStatus.h | 5 | ||||
-rw-r--r-- | Source/TableStatus.m | 24 |
2 files changed, 7 insertions, 22 deletions
diff --git a/Source/TableStatus.h b/Source/TableStatus.h index 73b68fd7..51c8b132 100644 --- a/Source/TableStatus.h +++ b/Source/TableStatus.h @@ -49,7 +49,7 @@ CMMCPResult *tableStatusResult; NSString *selectedTable; - NSDictionary* statusFields; + NSDictionary *statusFields; } // Table methods @@ -58,8 +58,5 @@ // Additional methods - (void)setConnection:(CMMCPConnection *)theConnection; -- (void)awakeFromNib; -// Initialization -- (id)init; @end diff --git a/Source/TableStatus.m b/Source/TableStatus.m index 36aa2043..9d4cf03f 100644 --- a/Source/TableStatus.m +++ b/Source/TableStatus.m @@ -4,11 +4,6 @@ @implementation TableStatus -- (void)awakeFromNib -{ - // TODO: implement awake code. -} - - (void)setConnection:(CMMCPConnection *)theConnection { mySQLConnection = theConnection; @@ -34,28 +29,20 @@ // Format date strings to the user's long date format else if ([aKey isEqualToString:@"Create_time"] || [aKey isEqualToString:@"Update_time"]) { - + // Create date formatter NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; - // Set the date format returned by MySQL - [dateFormatter setDateFormat:@"%Y-%m-%d %H:%M:%S"]; - - // Get the date instance - NSDate *date = [dateFormatter dateFromString:value]; - - // This behaviour should be set after the above date string is parsed to a date object so we can - // use the below style methods. [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; - + [dateFormatter setDateStyle:NSDateFormatterLongStyle]; [dateFormatter setTimeStyle:NSDateFormatterMediumStyle]; - - value = [dateFormatter stringFromDate:date]; + + value = [dateFormatter stringFromDate:[NSDate dateWithNaturalLanguageString:value]]; } } - NSString* labelVal = [NSString stringWithFormat:@"%@: %@", label, value]; + NSString *labelVal = [NSString stringWithFormat:@"%@: %@", label, value]; return labelVal; } @@ -136,4 +123,5 @@ return self; } + @end |