Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
4 | 2 | 2 | 0.981 | ExpressionStatement |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 4 | 261 | Closure/closure/goog/date/relative.js |
2 | 4 | 284 | Closure/closure/goog/date/relative.js |
| ||||
/** * Formats a date, adding the relative date in parenthesis. If the date is less * than 24 hours then the time will be printed, otherwise the full-date will be * used. Examples: * 2:20 PM (1 minute ago) * Monday, February 27, 2009 (4 days ago) * Tuesday, March 20, 2005 // Too long ago for a relative date. * * @param {Date} date A date object. * @param {string=} opt_shortTimeMsg An optional short time message can be * provided if available, so that it's not recalculated in this function. * @param {string=} opt_fullDateMsg An optional date message can be * provided if available, so that it's not recalculated in this function. * @return {string} The date string in the above form. */ goog.date.relative.getDateString= function ( date, opt_shortTimeMsg, opt_fullDateMsg) { return goog.date.relative.getDateString_( date, goog.date.relative.format, opt_shortTimeMsg, opt_fullDateMsg); } ; |
| ||||
/** * Formats a date, adding the relative date in parenthesis. Functions the same * as #getDateString but ensures that the date is always seen to be in the past. * If the date is in the future, it will be shown as 0 minutes ago. * * This is provided for compatibility with users of the previous incarnation of * the above {@see #getDateString} method who relied on it protecting against * future dates. * * @param {Date} date A timestamp or date object. * @param {string=} opt_shortTimeMsg An optional short time message can be * provided if available, so that it's not recalculated in this function. * @param {string=} opt_fullDateMsg An optional date message can be * provided if available, so that it's not recalculated in this function. * @return {string} The date string in the above form. */ goog.date.relative.getPastDateString= function ( date, opt_shortTimeMsg, opt_fullDateMsg) { return goog.date.relative.getDateString_( date, goog.date.relative.formatPast, opt_shortTimeMsg, opt_fullDateMsg); } ; |
| |||
/** * Formats a date, adding the relative date in parenthesis. Functions the same * as #getDateString but ensures that the date is always seen to be in the past. * If the date is in the future, it will be shown as 0 minutes ago. * * This is provided for compatibility with users of the previous incarnation of * the above {@see #getDateString} method who relied on it protecting against * future dates. * * @param {Date} date A timestamp or date object. * @param {string=} opt_shortTimeMsg An optional short time message can be * provided if available, so that it's not recalculated in this function. * @param {string=} opt_fullDateMsg An optional date message can be * provided if available, so that it's not recalculated in this function. * @return {string} The date string in the above form. */ /** * Formats a date, adding the relative date in parenthesis. If the date is less * than 24 hours then the time will be printed, otherwise the full-date will be * used. Examples: * 2:20 PM (1 minute ago) * Monday, February 27, 2009 (4 days ago) * Tuesday, March 20, 2005 // Too long ago for a relative date. * * @param {Date} date A date object. * @param {string=} opt_shortTimeMsg An optional short time message can be * provided if available, so that it's not recalculated in this function. * @param {string=} opt_fullDateMsg An optional date message can be * provided if available, so that it's not recalculated in this function. * @return {string} The date string in the above form. */ goog.date.relative. [[#variable2025a800]]= function (date,opt_shortTimeMsg,opt_fullDateMsg) { return goog.date.relative.getDateString_(date,goog.date.relative. [[#variable2025a780]],opt_shortTimeMsg,opt_fullDateMsg); } ; |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#2025a800]] | getPastDateString |
1 | 2 | [[#2025a800]] | getDateString |
2 | 1 | [[#2025a780]] | formatPast |
2 | 2 | [[#2025a780]] | format |