Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

Fix showSeconds bug and removed hour padding on timepicker #205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ng2-datetime",
"name": "flowconcept-ng2datetime",
"version": "1.4.0",
"description": "Bootstrap datetime picker for Angular",
"main": "ng2-datetime.js",
Expand All @@ -23,7 +23,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/nkalinov/ng2-datetime.git"
"url": "https://github.com/carol-braileanu/ng2-datetime"
},
"dependencies": {
"bootstrap": ">=3.0.0",
Expand Down
10 changes: 6 additions & 4 deletions src/ng2-datetime/ng2-datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ const CUSTOM_ACCESSOR = {
</div>
`,
styles: [
'.ng2-datetime *[hidden] { display: none; }'
`.ng2-datetime *[hidden] { display: none; }
.input-group { display: inline-table }
`
]
})

Expand Down Expand Up @@ -239,9 +241,9 @@ export class NKDatetime implements ControlValueAccessor, AfterViewInit, OnDestro
}
const meridian = date.getHours() >= 12 ? ' PM' : ' AM';
const time =
this.pad(hours) + ':' +
this.pad(this.date.getMinutes()) + ':' +
this.pad(this.date.getSeconds()) +
hours + ':' +
this.pad(this.date.getMinutes()) +
(this.timepickerOptions.showSeconds ? ':' + this.pad(this.date.getSeconds()) : '') +
(this.timepickerOptions.showMeridian || this.timepickerOptions.showMeridian === undefined
? meridian : '');
this.timepicker.timepicker('setTime', time);
Expand Down