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

fix ng2-datetime not working in Angular Material #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dangviettuan
Copy link

No description provided.

@wartab
Copy link
Contributor

wartab commented Aug 12, 2017

Please do not accept this pull request. This basically undoes my changes from my pull request 07dfe00 accepted 2 months ago that addressed the issues #166 and #170.

Besides that it hasn't been reviewed by @dangviettuan since it adds some console.log spam on line 184 and imposes code style changes for the sake of changing the code style (which has nothing to do with the reason of this pull request).

Also, parseInt's second argument should not be removed.
Quoting https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

If the input string begins with "0", radix is eight (octal) or 10 (decimal). Exactly which radix is chosen is implementation-dependent. ECMAScript 5 specifies that 10 (decimal) is used, but not all browsers support this yet. For this reason always specify a radix when using parseInt.

Adding to that, diverse linting tools will decline the lack of radix argument.

@wartab
Copy link
Contributor

wartab commented Aug 12, 2017

This PR also adds some parameters showDate and showTime, also not described in the PR.

@dangviettuan Addressing your issue, you need to encapsulate the datetime-picker in your form-group and add form-inline to your form/div yourself. This component is supposed to be a form element, not a form.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants