Skip to content

Commit

Permalink
fix the moment containing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Ceyer committed Nov 26, 2017
1 parent af4206a commit ef4566f
Show file tree
Hide file tree
Showing 12 changed files with 794 additions and 770 deletions.
403 changes: 210 additions & 193 deletions Gruntfile.js

Large diffs are not rendered by default.

176 changes: 104 additions & 72 deletions dist/js/pignose.calendar.full.js

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions dist/js/pignose.calendar.full.min.js

Large diffs are not rendered by default.

143 changes: 74 additions & 69 deletions dist/js/pignose.calendar.js
@@ -1,23 +1,20 @@

(function (root, factory) {
if (typeof define !== 'undefined' && define.amd) {
// AMD loader type declaration.
define(['jquery', 'moment'], function(jquery, moment) {
factory(window, document, jquery, moment);
if (root === undefined && window !== undefined) root = window;
if (typeof define === 'function' && define.amd) {
define(["jquery","moment"], function (jquery, moment) {
return (factory(jquery, moment));
});
} else if (typeof module === 'object' && module.exports) {
var module_exports = factory(require("jquery"),require("moment"));
module.exports = module_exports;

} else {
factory(root["jquery"],root["moment"]);
}
else if (typeof module === 'object') {
var jsdom = require('jsdom').jsdom;
var _document = jsdom('<html></html>', {});
var _window = _document.defaultView;
var _jquery = require('jquery')(_window);
var _moment = require('moment');
module.exports = factory(_window, _document, _jquery, _moment);
}
else {
root.pignoseCalendar = factory(window, document, jQuery, moment);
}
}(this, function (window, document, jquery, moment) {
/**
}(this, function (jquery, moment) {

/**
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
*/
Expand Down Expand Up @@ -700,47 +697,47 @@ define('component/global',['../configures/i18n'], function (languages) {
;


define('component/options',['./global'], function (Global) {
return {
lang: null,
languages: Global.languages,
theme: 'light',
date: moment(),
format: Global.format,
enabledDates: [],
disabledDates: [],
disabledWeekdays: [],
disabledRanges: [],
schedules: [],
scheduleOptions: {
colors: {}
},
week: Global.week,
weeks: Global.languages.weeks.en,
monthsLong: Global.languages.monthsLong.en,
months: Global.languages.months.en,
pickWeeks: false,
initialize: true,
multiple: false,
toggle: false,
reverse: false,
buttons: false,
modal: false,
selectOver: false,
minDate: null,
maxDate: null,

/********************************************
* EVENTS
*******************************************/
init: null,
select: null,
apply: null,
click: null,
page: null,
prev: null,
next: null
};
define('component/options',['moment', './global'], function (moment, Global) {
return {
lang: null,
languages: Global.languages,
theme: 'light',
date: moment(),
format: Global.format,
enabledDates: [],
disabledDates: [],
disabledWeekdays: [],
disabledRanges: [],
schedules: [],
scheduleOptions: {
colors: {}
},
week: Global.week,
weeks: Global.languages.weeks.en,
monthsLong: Global.languages.monthsLong.en,
months: Global.languages.months.en,
pickWeeks: false,
initialize: true,
multiple: false,
toggle: false,
reverse: false,
buttons: false,
modal: false,
selectOver: false,
minDate: null,
maxDate: null,

/********************************************
* EVENTS
*******************************************/
init: null,
select: null,
apply: null,
click: null,
page: null,
prev: null,
next: null
};
});
//# sourceMappingURL=options.js.map
;
Expand Down Expand Up @@ -1720,20 +1717,28 @@ define('main',['core', 'component/models'], function (Component, Models) {
;


define('plugin',['main', 'component/models', 'jquery'], function (Constructor, models, $) {
'use strict';
var Constructor = require('main');
var models = require('component/models');
var $ = require('jquery');

$.fn[models.ComponentName] = function (options) {
return Constructor.apply(Constructor, [this, options].concat(Array.prototype.splice.call(arguments, 1)));
};
var root = window ? window : undefined || {};

for (var idx in models) {
$.fn[models.ComponentName][idx] = models[idx];
}
root.moment = require('moment');

return Constructor;
});
$.fn[models.ComponentName] = function (options) {
return Constructor.apply(Constructor, [this, options].concat(Array.prototype.splice.call(arguments, 1)));
};

for (var key in models) {
$.fn[models.ComponentName][key] = models[key];
}
//# sourceMappingURL=jquery.js.map
;
return require('plugin');
define("plugins/jquery.js", function(){});




return ;

}));
6 changes: 3 additions & 3 deletions dist/js/pignose.calendar.min.js

Large diffs are not rendered by default.

107 changes: 50 additions & 57 deletions examples/basic.html
Expand Up @@ -15,7 +15,7 @@
<link rel="stylesheet" type="text/css" href="../demo/css/prism.css" />
<link rel="stylesheet" type="text/css" href="../demo/css/calendar-style.css" />
<link rel="stylesheet" type="text/css" href="../demo/css/style.css" />
<link rel="stylesheet" type="text/css" href="../dist/css/pignose.calendar.css" />
<link rel="stylesheet" type="text/css" href="../dist/css/pignose.calendar.min.css" />
<style type="text/css">
.input-calendar {
display: block;
Expand All @@ -28,9 +28,6 @@
padding: 0 1.2em;
border: 1px solid #d8d8d8;
box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
-o-box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
-moz-box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
-webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.btn-calendar {
Expand All @@ -45,65 +42,12 @@
color: #ffffff !important;
text-decoration: none !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
-o-box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
-moz-box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
-webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.btn-calendar:hover {
background-color: #5a6268;
}
</style>
<script type="text/javascript" src="../demo/js/jquery.latest.min.js"></script>
<script type="text/javascript" src="../demo/js/moment.latest.min.js"></script>
<script type="text/javascript" src="../demo/js/semantic.ui.min.js"></script>
<script type="text/javascript" src="../demo/js/prism.min.js"></script>
<script type="text/javascript" src="../dist/js/pignose.calendar.js"></script>
<script type="text/javascript">
//<![CDATA[
$(function() {
$('#wrapper .version strong').text('v' + $.fn.pignoseCalendar.ComponentVersion);

function onClickHandler(date, obj) {
/**
* @date is an array which be included dates(clicked date at first index)
* @obj is an object which stored calendar interal data.
* @obj.calendar is an element reference.
* @obj.storage.activeDates is all toggled data, If you use toggle type calendar.
* @obj.storage.events is all events associated to this date
*/

var $calendar = obj.calendar;
var $box = $calendar.parent().siblings('.box').show();
var text = 'You choose date ';

if(date[0] !== null) {
text += date[0].format('YYYY-MM-DD');
}

if(date[0] !== null && date[1] !== null) {
text += ' ~ ';
} else if(date[0] === null && date[1] == null) {
text += 'nothing';
}

if(date[1] !== null) {
text += date[1].format('YYYY-MM-DD');
}

$box.text(text);
}

// Default Calendar
$('.calendar').pignoseCalendar({
select: onClickHandler
});

// This use for DEMO page tab component.
$('.menu .item').tab();
});
//]]>
</script>
</head>
<body>
<div id="wrapper">
Expand Down Expand Up @@ -131,5 +75,54 @@ <h3><span>Basic</span></h3>
</div>
</div>
</div>
<script type="text/javascript" src="../demo/js/jquery.latest.min.js"></script>
<script type="text/javascript" src="../demo/js/semantic.ui.min.js"></script>
<script type="text/javascript" src="../demo/js/prism.min.js"></script>
<script type="text/javascript" src="../dist/js/pignose.calendar.full.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(function() {
$('#wrapper .version strong').text('v' + $.fn.pignoseCalendar.ComponentVersion);

function onClickHandler(date, obj) {
/**
* @date is an array which be included dates(clicked date at first index)
* @obj is an object which stored calendar interal data.
* @obj.calendar is an element reference.
* @obj.storage.activeDates is all toggled data, If you use toggle type calendar.
* @obj.storage.events is all events associated to this date
*/

var $calendar = obj.calendar;
var $box = $calendar.parent().siblings('.box').show();
var text = 'You choose date ';

if(date[0] !== null) {
text += date[0].format('YYYY-MM-DD');
}

if(date[0] !== null && date[1] !== null) {
text += ' ~ ';
} else if(date[0] === null && date[1] == null) {
text += 'nothing';
}

if(date[1] !== null) {
text += date[1].format('YYYY-MM-DD');
}

$box.text(text);
}

// Default Calendar
$('.calendar').pignoseCalendar({
select: onClickHandler
});

// This use for DEMO page tab component.
$('.menu .item').tab();
});
//]]>
</script>
</body>
</html>

0 comments on commit ef4566f

Please sign in to comment.