Skip to content

Commit

Permalink
Fix failing time related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nosir committed Dec 16, 2018
1 parent 134b96f commit d5bd513
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 10 deletions.
7 changes: 7 additions & 0 deletions dist/cleave-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ return /******/ (function(modules) { // webpackBootstrap
return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
},

getISOFormatTime: function () {
var owner = this,
pps = owner.properties;

return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
},

getFormattedValue: function () {
return this.element.value;
},
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave-angular.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/cleave-react-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ return /******/ (function(modules) { // webpackBootstrap
return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
},

getISOFormatTime: function getISOFormatTime() {
var owner = this,
pps = owner.properties;

return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
},

onInit: function onInit(owner) {
return owner;
},
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave-react-node.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/cleave-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ return /******/ (function(modules) { // webpackBootstrap
return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
},

getISOFormatTime: function getISOFormatTime() {
var owner = this,
pps = owner.properties;

return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
},

onInit: function onInit(owner) {
return owner;
},
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave-react.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ return /******/ (function(modules) { // webpackBootstrap
return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
},

getISOFormatTime: function () {
var owner = this,
pps = owner.properties;

return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
},

getFormattedValue: function () {
return this.element.value;
},
Expand Down
4 changes: 2 additions & 2 deletions dist/cleave.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"form",
"input"
],
"version": "1.4.4",
"version": "1.4.5",
"files": [
"src",
"dist",
Expand Down
7 changes: 7 additions & 0 deletions src/Cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ Cleave.prototype = {
return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
},

getISOFormatTime: function () {
var owner = this,
pps = owner.properties;

return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
},

getFormattedValue: function () {
return this.element.value;
},
Expand Down
7 changes: 7 additions & 0 deletions src/Cleave.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ var cleaveReactClass = CreateReactClass({
return pps.date ? pps.dateFormatter.getISOFormatDate() : '';
},

getISOFormatTime: function () {
var owner = this,
pps = owner.properties;

return pps.time ? pps.timeFormatter.getISOFormatTime() : '';
},

onInit: function (owner) {
return owner;
},
Expand Down
2 changes: 1 addition & 1 deletion test/browser/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Time input field', function () {

it('should correct large time hour to add leading 0', function () {
cleave.setRawValue('4');
assert.equal(field.value, '02:');
assert.equal(field.value, '04:');
});

it('should correct large min to add leading 0', function () {
Expand Down

0 comments on commit d5bd513

Please sign in to comment.