Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gregorian-calendar

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gregorian-calendar - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

build/gregorian-calendar-debug.js

30

gulpfile.js

@@ -17,2 +17,3 @@ var gulp = require('gulp');

var replace = require('gulp-replace');
var through2 = require('through2');

@@ -33,4 +34,28 @@ gulp.task('lint', function () {

gulp.task('build', ['lint'], function () {
gulp.task('build-locale', ['lint'], function () {
var tag = 'gregorian-calendar';
gulp.src('./lib/' + tag + '/i18n/*.js')
.pipe(replace(/@VERSION@/g, packageInfo.version))
.pipe(through2.obj(function (s, encoding, callback) {
var name = tag + '/i18n/' + path.basename(s.path, '.js');
var contents = 'modulex.add("' + name + '",[], function(require, exports, module) {' + s.contents.toString('utf-8') + '});';
s.contents = new Buffer(contents, 'utf-8');
this.push(s);
callback();
}))
.pipe(rename(function (path) {
path.basename += '-debug';
}))
.pipe(gulp.dest(path.resolve(build, tag + '/i18n/')))
.pipe(replace(/@DEBUG@/g, ''))
.pipe(uglify())
.pipe(rename(function (path) {
path.basename = path.basename.replace(/-debug/, '');
}))
.pipe(gulp.dest(path.resolve(build, tag + '/i18n/')));
});
gulp.task('build', ['lint', 'build-locale'], function () {
var tag = 'gregorian-calendar';
var packages = {};

@@ -44,3 +69,4 @@ packages[tag] = {

packages: packages
}
},
excludeModules: [tag + '/i18n/zh-cn']
}))

@@ -47,0 +73,0 @@ .pipe(kclean({

module.exports = require('./lib/gregorian-calendar');
module.exports.locales = {
'en-us': require('./lib/gregorian-calendar/i18n/en-us'),
'zh-cn': require('./lib/gregorian-calendar/i18n/zh-cn')
};
module.exports.version = require('./package.json').version;

7

lib/gregorian-calendar.js

@@ -8,7 +8,6 @@ /**

var Utils = require('./gregorian-calendar/utils');
var enUsLocale = require('./gregorian-calendar/i18n/en-us');
var zhCnLocale = require('./gregorian-calendar/i18n/zh-cn');
var requireFn = require;
var defaultLocale;
if (typeof process !== 'undefined') {
defaultLocale = enUsLocale;
defaultLocale = requireFn('./gregorian-calendar/i18n/en-us');
} else {

@@ -1342,4 +1341,2 @@ defaultLocale = require('i18n!gregorian-calendar');

GregorianCalendar.version = '@VERSION@';
GregorianCalendar.enUsLocale = enUsLocale;
GregorianCalendar.zhCnLocale = zhCnLocale;
/*

@@ -1346,0 +1343,0 @@ http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html

{
"name": "gregorian-calendar",
"version": "1.0.1",
"version": "1.0.2",
"author": "yiminghe <yiminghe@gmail.com>",

@@ -55,3 +55,4 @@ "engines": {

"node-jscover-handler": "^1.0.3",
"precommit-hook": "^1.0.7"
"precommit-hook": "^1.0.7",
"through2": "^0.6.2"
},

@@ -58,0 +59,0 @@ "precommit": [

@@ -91,3 +91,2 @@ /**

describe('WEEK_OF_MONTH', function () {

@@ -94,0 +93,0 @@ it('simply works', function () {

var GregorianCalendar = require('../../');
var date = new GregorianCalendar();
var date = new GregorianCalendar(GregorianCalendar.locales['zh-cn']);
date.setTime(+new Date());
console.log(date.getDayOfWeek());
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc