Sha256: f94b4f6750478734f98b17050cfeb796fa80dd002654d766b3279384098b9d6a

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 KB

Contents

I"g(function() {
  App.Services.Date = (function() {
    function Date(date) {
      this.date = date;
    }

    Date.prototype.toString = function(format) {
      var skope;
      if (format == null) {
        format = 'default';
      }
      skope = App.I18n[App.Env.loco.getLocale()].date.formats;
      switch (format) {
        case 'default':
          return this.strftime(skope["default"]);
        case 'short':
          return this.strftime(skope.short);
        case 'long':
          return this.strftime(skope.long);
        default:
          return console.log('App.Services.Date#toString: unknown format.');
      }
    };

    Date.prototype.strftime = function(str) {
      var skope;
      skope = App.I18n[App.Env.loco.getLocale()];
      str = str.replace('%Y', (function(_this) {
        return function(x) {
          return _this.date.getFullYear();
        };
      })(this));
      str = str.replace('%y', (function(_this) {
        return function(x) {
          return _this.date.getFullYear().toString().slice(-2);
        };
      })(this));
      str = str.replace('%m', (function(_this) {
        return function(x) {
          return _this.date.getMonth() + 1;
        };
      })(this));
      str = str.replace('%b', (function(_this) {
        return function(x) {
          return skope.date.abbr_month_names[_this.date.getMonth()];
        };
      })(this));
      str = str.replace('%B', (function(_this) {
        return function(x) {
          return skope.date.month_names[_this.date.getMonth()];
        };
      })(this));
      return str = str.replace('%d', (function(_this) {
        return function(x) {
          if (_this.date.getDate() >= 10) {
            return _this.date.getDate();
          } else {
            return "0" + (_this.date.getDate());
          }
        };
      })(this));
    };

    return Date;

  })();

}).call(this);
:ET

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/RJi2rNx5DLzHM-J4hUgEsx7Vdpl_wx1wD5aae0oKk74.cache