File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,24 @@ Commit.prototype.time = function(callback) {
123123 } ) ;
124124} ;
125125
126+ /**
127+ * Retrieve the commit time as a Date object.
128+ *
129+ * @param {Commit~dateCallback } callback
130+ */
131+ Commit . prototype . date = function ( callback ) {
132+ /**
133+ * @callback Commit~dateCallback Callback executed on date retrieval.
134+ * @param {GitError|null } error An Error or null if successful.
135+ * @param {Date|null } time Retrieved time as a Date object.
136+ */
137+ this . time ( function ( error , time ) {
138+ if ( success ( error , callback ) ) {
139+ callback ( null , new Date ( time * 1000 ) ) ;
140+ }
141+ } ) ;
142+ } ;
143+
126144/**
127145 * Retrieve the commit's positive or negative timezone offset, in minutes from UTC.
128146 *
You can’t perform that action at this time.
0 commit comments