Skip to content

Commit

Permalink
Fix for #385 - fix rollover deficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsage committed Jan 11, 2016
1 parent 9b72649 commit ed0f4e6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
16 changes: 16 additions & 0 deletions Gruntfile.js
Expand Up @@ -426,6 +426,22 @@ module.exports = function(grunt) {
"prettify",
"makei18n"
] );

grunt.registerTask( "bugrelease", "Build a bug release version of DateBox", [
"jshint:js",
"jshint:js2",
//"qunit",
"clean:release",
"clean:web",
"buildDBox:main_jqm",
"buildDBox:main_bootstrap",
"buildDBox:main_jqueryui",
"exec:main_make_css_jqm",
"exec:main_make_css_bootstrap",
"exec:main_make_css_jqueryui",
"uglify:release",
"cssmin:release",
] );

grunt.registerTask( "latest", "Build a working version of DateBox (no testing)", [
"clean:latest",
Expand Down
12 changes: 6 additions & 6 deletions src/js/lib/offset.js
Expand Up @@ -32,7 +32,7 @@ JTSageDateBox._offset = function(mode, amount, update) {
ok = 1;
} else {
tempBad = now.get(1) + amount;
if ( bad < 0 ) {
if ( tempBad < 0 ) {
bad = [1, 12 + tempBad];
} else {
bad = [1, tempBad % 12];
Expand Down Expand Up @@ -60,10 +60,10 @@ JTSageDateBox._offset = function(mode, amount, update) {
ok = 3;
} else {
tempBad = now.get(3) + amount;
if ( bad < 0 ) {
bad = [3, 23 + tempBad];
if ( tempBad < 0 ) {
bad = [3, 24 + tempBad];
} else {
bad = [3, tempBad % 23];
bad = [3, tempBad % 24];
}
}
break;
Expand All @@ -72,10 +72,10 @@ JTSageDateBox._offset = function(mode, amount, update) {
ok = 4;
} else {
tempBad = now.get(4) + amount;
if ( bad < 0 ) {
if ( tempBad < 0 ) {
bad = [4, 59 + tempBad];
} else {
bad = [4, tempBad % 59];
bad = [4, tempBad % 60];
}
}
break;
Expand Down
4 changes: 2 additions & 2 deletions work/bootstrap.html
Expand Up @@ -74,7 +74,7 @@
useInlineAlign: "middle",
calDateList: [["1980-04-25", "JTs Date of Birth"], ["1809-02-12", "Lincolns Birthday"]],
calShowDateList: true,
rolloverMode: { 'd': false, 'm': false, 'y': false },
rolloverMode: { 'm': false, 'd': false, 'h': false, 'i': false, 's': false },

calUsePickers: true,
//calUsePickersIcons: true,
Expand Down Expand Up @@ -120,7 +120,7 @@ <h1>DateBox <small>BootStrap Dev Page</small></h1>

<div class="form-group">
<label class="control-label"for="lang1">yep</label>
<input class="form-control" name="lang1" type="text" data-role="datebox" data-datebox-mode="calbox" id="lang1" data-options='{}' />
<input class="form-control" name="lang1" type="text" data-role="datebox" data-datebox-mode="timeflipbox" id="lang1" data-options='{}' />
</div>


Expand Down

0 comments on commit ed0f4e6

Please sign in to comment.