CloneSet73


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
101210.987SourceElements[8]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
189256
Closure/closure/goog/i18n/timezone.js
2101222
Closure/closure/goog/locale/timezone.js
Clone Instance
1
Line Count
89
Source Line
256
Source File
Closure/closure/goog/i18n/timezone.js

/**
 * Return the DST adjustment to the time zone offset for a given time.
 * While Daylight Saving Time is in effect, this number is positive.
 * Otherwise, it is zero.
 * @param {Date} date The time to check.
 * @return {number} The DST adjustment in minutes EAST of UTC.
 */
goog.i18n.TimeZone.prototype.getDaylightAdjustment=  function (date){
  var timeInMs=  Date.UTC(date.getUTCFullYear( ),date.getUTCMonth( ),
                          date.getUTCDate( ),date.getUTCHours( ),
                          date.getUTCMinutes( ));
  var timeInHours=  timeInMs/  goog.i18n.TimeZone.MILLISECONDS_PER_HOUR_;
  var index=  0;
  while (index<  this.transitions_.length
         &&timeInHours>=  this.transitions_[index])
                                                  {
    index+=  2;
                                                  }
  return (index==  0)
         ?              0
         :                  this.transitions_[index-  1];
                                                                    } ;
/**
 * Return the GMT representation of this time zone object.
 * @param {Date} date The date for which time to retrieve GMT string.
 * @return {string} GMT representation string.
 */
goog.i18n.TimeZone.prototype.getGMTString=  function (date){
  return goog.i18n.TimeZone.composeGMTString_(this.getOffset(date));
                                                           } ;

/**
 * Get the long time zone name for a given date/time.
 * @param {Date} date The time for which to retrieve the long time zone name.
 * @return {string} The long time zone name.
 */
goog.i18n.TimeZone.prototype.getLongName=  function (date){
  return this.tzNames_[this.isDaylightTime(date)
                       ?goog.i18n.TimeZone.NameType.DLT_LONG_NAME
                       :goog.i18n.TimeZone.NameType.STD_LONG_NAME];
                                                          } ;


/**
 * Get the time zone offset in minutes WEST of UTC for a given date/time.
 * @param {Date} date The time for which to retrieve the time zone offset.
 * @return {number} The time zone offset in minutes WEST of UTC.
 */
goog.i18n.TimeZone.prototype.getOffset=  function (date){
  return this.standardOffset_-  this.getDaylightAdjustment(date);
                                                        } ;


/**
 * Get the RFC representation of the time zone for a given date/time.
 * @param {Date} date The time for which to retrieve the RFC time zone string.
 * @return {string} The RFC time zone string.
 */
goog.i18n.TimeZone.prototype.getRFCTimeZoneString=  function (date){
  var offset=  -this.getOffset(date);
  var parts=  [offset<  0
               ?            '-'
               :                  '+'];
  offset=  Math.abs(offset);
  parts.push(goog.string.padNumber(Math.floor(offset/  60)%  100, 2),
             goog.string.padNumber(offset%  60, 2));
  return parts.join('');
                                                                   } ;
/**
 * Get the short time zone name for given date/time.
 * @param {Date} date The time for which to retrieve the short time zone name.
 * @return {string} The short time zone name.
 */
goog.i18n.TimeZone.prototype.getShortName=  function (date){
  return this.tzNames_[this.isDaylightTime(date)
                       ?goog.i18n.TimeZone.NameType.DLT_SHORT_NAME
                       :goog.i18n.TimeZone.NameType.STD_SHORT_NAME];
                                                           } ;


/**
 * Return the time zone ID for this time zone.
 * @return {string} The time zone ID.
 */
goog.i18n.TimeZone.prototype.getTimeZoneId=  function ( )
                                                        {
  return this.timeZoneId_;
                                                        } ;

/**
 * Check if Daylight Saving Time is in effect at a given time in this time zone.
 * @param {Date} date The time to check.
 * @return {boolean} True if Daylight Saving Time is in effect.
 */
goog.i18n.TimeZone.prototype.isDaylightTime=  function (date){
  return this.getDaylightAdjustment(date)>  0;
                                                             } ;


Clone Instance
2
Line Count
101
Source Line
222
Source File
Closure/closure/goog/locale/timezone.js

/**
 * Return the adjustment amount of time zone offset. When daylight time
 * is in effect, this number will be positive. Otherwise, it is zero.
 * @param {Date} date the time to check.
 * @return {number} offset amount.
 * @deprecated Use goog.i18n.TimeZone.prototype.getDaylightAdjustment.
 */
goog.locale.TimeZone.prototype.getDaylightAdjustment=  function (date){
  var timeInMs=  Date.UTC(date.getUTCFullYear( ),date.getUTCMonth( ),
                          date.getUTCDate( ),date.getUTCHours( ),
                          date.getUTCMinutes( ));
  var timeInHours=  timeInMs/  goog.locale.TimeZone.MILLISECONDS_PER_HOUR_;
  var index=  0;
  while (index<  this.transitions_.length
         &&timeInHours>=  this.transitions_[index])
                                                  {
    index+=  2;
                                                  }
  return (index==  0)
         ?              0
         :                  this.transitions_[index-  1];
                                                                      } ;
/**
 * Return the GMT representation of this time zone object.
 * @param {Date} date The date for which time to retrieve GMT string.
 * @return {string} GMT representation string.
 * @deprecated Use goog.i18n.TimeZone.prototype.getGMTString.
 */
goog.locale.TimeZone.prototype.getGMTString=  function (date){
  return goog.locale.TimeZone.composeGMTString_(this.getOffset(date));
                                                             } ;

/**
 * To get long time zone name for given date.
 * @param {Date} date The Date object for which time to retrieve long time
 *     zone name.
 * @return {string} long time zone name.
 * @deprecated Use goog.i18n.TimeZone.prototype.getLongName.
 */
goog.locale.TimeZone.prototype.getLongName=  function (date){
  return this.tzNames_[this.isDaylightTime(date)
                       ?goog.locale.TimeZone.NameType.DLT_LONG_NAME
                       :goog.locale.TimeZone.NameType.STD_LONG_NAME];
                                                            } ;


/**
 * To get time zone offset (in minutes) relative to UTC for given date.
 * To be consistent with JDK/Javascript API, west of Greenwich will be
 * positive.
 *
 * @param {Date} date The date for which time to retrieve time zone offset.
 * @return {number} time zone offset in minutes.
 * @deprecated Use goog.i18n.TimeZone.prototype.getOffset.
 */
goog.locale.TimeZone.prototype.getOffset=  function (date){
  return this.standardOffset_-  this.getDaylightAdjustment(date);
                                                          } ;


/**
 * To get RFC representation of certain time zone name for given date.
 * @param {Date} date The Date object for which time to retrieve RFC time
 *     zone string.
 * @return {string} RFC time zone string.
 * @deprecated Use goog.i18n.TimeZone.prototype.getRFCTimeZoneString.
 */
goog.locale.TimeZone.prototype.getRFCTimeZoneString=  function (date){
  var offset=  -this.getOffset(date);
  var parts=  [offset<  0
               ?            '-'
               :                  '+'];
  offset=  Math.abs(offset);
  parts.push(goog.string.padNumber(Math.floor(offset/  60)%  100, 2),
             goog.string.padNumber(offset%  60, 2));
  return parts.join('');
                                                                     } ;
/**
 * To get short time zone name for given date.
 * @param {Date} date The date for which time to retrieve short time zone.
 * @return {string} short time zone name.
 * @deprecated Use goog.i18n.TimeZone.prototype.getShortName.
 */
goog.locale.TimeZone.prototype.getShortName=  function (date){
  return this.tzNames_[this.isDaylightTime(date)
                       ?goog.locale.TimeZone.NameType.DLT_SHORT_NAME
                       :goog.locale.TimeZone.NameType.STD_SHORT_NAME];
                                                             } ;


/**
 * Return time zone id for this time zone.
 * @return {string} time zone id.
 * @deprecated Use goog.i18n.TimeZone.prototype.getTimeZoneId.
 */
goog.locale.TimeZone.prototype.getTimeZoneId=  function ( )
                                                          {
  return this.timeZoneId_;
                                                          } ;

/**
 * Check if the given time fall within daylight saving period.
 * @param {Date} date time for which to check.
 * @return {boolean} true if daylight time in effect.
 * @deprecated Use goog.i18n.TimeZone.prototype.isDaylightTime.
 */
goog.locale.TimeZone.prototype.isDaylightTime=  function (date){
  return this.getDaylightAdjustment(date)>  0;
                                                               } ;


Clone AbstractionParameter Count: 1Parameter Bindings

/**
 * Return the adjustment amount of time zone offset. When daylight time
 * is in effect, this number will be positive. Otherwise, it is zero.
 * @param {Date} date the time to check.
 * @return {number} offset amount.
 * @deprecated Use goog.i18n.TimeZone.prototype.getDaylightAdjustment.
 */
/**
 * Return the DST adjustment to the time zone offset for a given time.
 * While Daylight Saving Time is in effect, this number is positive.
 * Otherwise, it is zero.
 * @param {Date} date The time to check.
 * @return {number} The DST adjustment in minutes EAST of UTC.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getDaylightAdjustment= function (date)
                                                                      { var timeInMs=Date.UTC(date.getUTCFullYear( ),date.getUTCMonth( ),date.getUTCDate( ),date.getUTCHours( ),date.getUTCMinutes( ));
                                                                        var timeInHours=timeInMs/goog. [[#variable62fc7580]].TimeZone.MILLISECONDS_PER_HOUR_;
                                                                        var index=0;
                                                                        while (index<this.transitions_.length
                                                                               && timeInHours>=this.transitions_[index])
                                                                          { index+=2;
                                                                          }
                                                                        return (index==0)
                                                                               ?0
                                                                               : this.transitions_[index-1];
                                                                      } ;
/**
 * Return the GMT representation of this time zone object.
 * @param {Date} date The date for which time to retrieve GMT string.
 * @return {string} GMT representation string.
 * @deprecated Use goog.i18n.TimeZone.prototype.getGMTString.
 */
/**
 * Return the GMT representation of this time zone object.
 * @param {Date} date The date for which time to retrieve GMT string.
 * @return {string} GMT representation string.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getGMTString= function (date)
                                                             { return goog. [[#variable62fc7580]].TimeZone.composeGMTString_(this.getOffset(date));
                                                             } ;
/**
 * To get long time zone name for given date.
 * @param {Date} date The Date object for which time to retrieve long time
 *     zone name.
 * @return {string} long time zone name.
 * @deprecated Use goog.i18n.TimeZone.prototype.getLongName.
 */
/**
 * Get the long time zone name for a given date/time.
 * @param {Date} date The time for which to retrieve the long time zone name.
 * @return {string} The long time zone name.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getLongName= function (date)
                                                            { return this.tzNames_[this.isDaylightTime(date)
                                                                                   ?goog. [[#variable62fc7580]].TimeZone.NameType.DLT_LONG_NAME
                                                                                   :goog. [[#variable62fc7580]].TimeZone.NameType.STD_LONG_NAME];
                                                            } ;
/**
 * To get time zone offset (in minutes) relative to UTC for given date.
 * To be consistent with JDK/Javascript API, west of Greenwich will be
 * positive.
 *
 * @param {Date} date The date for which time to retrieve time zone offset.
 * @return {number} time zone offset in minutes.
 * @deprecated Use goog.i18n.TimeZone.prototype.getOffset.
 */
/**
 * Get the time zone offset in minutes WEST of UTC for a given date/time.
 * @param {Date} date The time for which to retrieve the time zone offset.
 * @return {number} The time zone offset in minutes WEST of UTC.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getOffset= function (date)
                                                          { return this.standardOffset_-this.getDaylightAdjustment(date);
                                                          } ;
/**
 * To get RFC representation of certain time zone name for given date.
 * @param {Date} date The Date object for which time to retrieve RFC time
 *     zone string.
 * @return {string} RFC time zone string.
 * @deprecated Use goog.i18n.TimeZone.prototype.getRFCTimeZoneString.
 */
/**
 * Get the RFC representation of the time zone for a given date/time.
 * @param {Date} date The time for which to retrieve the RFC time zone string.
 * @return {string} The RFC time zone string.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getRFCTimeZoneString= function (date)
                                                                     { var offset=-this.getOffset(date);
                                                                       var parts=[offset<0
                                                                                  ?'-'
                                                                                  : '+'];
                                                                       offset=Math.abs(offset);
                                                                       parts.push(goog.string.padNumber(Math.floor(offset/60)%100,2),goog.string.padNumber(offset%60,2));
                                                                       return parts.join('');
                                                                     } ;
/**
 * To get short time zone name for given date.
 * @param {Date} date The date for which time to retrieve short time zone.
 * @return {string} short time zone name.
 * @deprecated Use goog.i18n.TimeZone.prototype.getShortName.
 */
/**
 * Get the short time zone name for given date/time.
 * @param {Date} date The time for which to retrieve the short time zone name.
 * @return {string} The short time zone name.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getShortName= function (date)
                                                             { return this.tzNames_[this.isDaylightTime(date)
                                                                                    ?goog. [[#variable62fc7580]].TimeZone.NameType.DLT_SHORT_NAME
                                                                                    :goog. [[#variable62fc7580]].TimeZone.NameType.STD_SHORT_NAME];
                                                             } ;
/**
 * Return time zone id for this time zone.
 * @return {string} time zone id.
 * @deprecated Use goog.i18n.TimeZone.prototype.getTimeZoneId.
 */
/**
 * Return the time zone ID for this time zone.
 * @return {string} The time zone ID.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.getTimeZoneId= function ( )
                                                              { return this.timeZoneId_;
                                                              } ;
/**
 * Check if the given time fall within daylight saving period.
 * @param {Date} date time for which to check.
 * @return {boolean} true if daylight time in effect.
 * @deprecated Use goog.i18n.TimeZone.prototype.isDaylightTime.
 */
/**
 * Check if Daylight Saving Time is in effect at a given time in this time zone.
 * @param {Date} date The time to check.
 * @return {boolean} True if Daylight Saving Time is in effect.
 */
goog. [[#variable62fc7580]].TimeZone.prototype.isDaylightTime= function (date)
                                                               { return this.getDaylightAdjustment(date)>0;
                                                               } ;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#62fc7580]]
locale 
12[[#62fc7580]]
i18n