Skip to content

Commit

Permalink
Merge pull request #107 from getyoti/SDK-1255-YotiDateFormat
Browse files Browse the repository at this point in the history
SDK-1255: Fix YotiDate format
  • Loading branch information
MrBurtyyy authored Oct 22, 2019
2 parents bd5316a + 3fafd49 commit 510df5d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoti",
"version": "3.7.2",
"version": "3.7.3",
"description": "Yoti NodeJS SDK for back-end integration",
"author": "Yoti LTD <[email protected]> (https://www.yoti.com/developers)",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectKey = yoti-web-sdk:node
sonar.projectName = node-sdk
sonar.projectVersion = 3.7.2
sonar.projectVersion = 3.7.3
sonar.exclusions=tests/**,examples/**,node_modules/**,coverage/**
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.verbose = true
2 changes: 1 addition & 1 deletion src/data_type/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class YotiDate extends Date {
*/
getMicrosecondTime() {
const hours = formatDatePart(this.getUTCHours(), 2);
const minutes = formatDatePart(this.getUTCMinutes());
const minutes = formatDatePart(this.getUTCMinutes(), 2);
const secondsMicroseconds = formatSecondsWithMicroseconds(
this.getUTCSeconds(),
this.getMicroseconds()
Expand Down
7 changes: 7 additions & 0 deletions tests/data_type/date.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ describe('YotiDate', () => {
});
});

describe('#getMicrosecondTime', () => {
const smallDate = new YotiDate(1571630945010000);
it('should return zero padded in correct ISO format', () => {
expect(smallDate.getMicrosecondTime()).toBe('04:09:05.010000');
});
});

describe('#getMicroseconds()', () => {
it('should return 923530', () => {
expect(date.getMicroseconds()).toBe(923530);
Expand Down

0 comments on commit 510df5d

Please sign in to comment.