Browse files

Add time zone support to GTCommit.

  • Loading branch information...
1 parent f68813d commit 63ee416a8c5fe30683c9262ec30c07896f0b05a0 Danny Greg committed Mar 28, 2013
Showing with 9 additions and 1 deletion.
  1. +1 −0 Classes/GTCommit.h
  2. +8 −1 Classes/GTCommit.m
View
1 Classes/GTCommit.h
@@ -44,6 +44,7 @@
@property (nonatomic, readonly) NSString *messageDetails;
@property (nonatomic, readonly) NSString *messageSummary;
@property (nonatomic, readonly) NSDate *commitDate;
+@property (nonatomic, readonly) NSTimeZone *commitTimeZone;
@property (nonatomic, readonly) GTTree *tree;
+ (GTCommit *)commitInRepository:(GTRepository *)theRepo updateRefNamed:(NSString *)refName author:(GTSignature *)authorSig committer:(GTSignature *)committerSig message:(NSString *)newMessage tree:(GTTree *)theTree parents:(NSArray *)theParents error:(NSError **)error;
View
9 Classes/GTCommit.m
@@ -122,7 +122,14 @@ - (NSString *)messageSummary {
- (NSDate *)commitDate {
git_time time = (git_time){.time = git_commit_time(self.git_commit), .offset = git_commit_time_offset(self.git_commit)};
- return [NSDate gt_dateFromGitTime:time];
+ return [NSDate gt_dateFromGitTime:time timeZone:NULL];
+}
+
+- (NSTimeZone *)commitTimeZone {
+ NSTimeZone *timeZone = nil;
+ git_time time = (git_time){.time = git_commit_time(self.git_commit), .offset = git_commit_time_offset(self.git_commit)};
+ [NSDate gt_dateFromGitTime:time timeZone:&timeZone];
+ return timeZone;
}
- (GTSignature *)author {

0 comments on commit 63ee416

Please sign in to comment.