Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › General Discussions › Date & Time Pickers › smart-date-time-picker and Angular reactive form setvalue
Tagged: datetimepicker reactive
- This topic has 5 replies, 3 voices, and was last updated 4 years, 8 months ago by
yavordashew.
-
AuthorPosts
-
February 9, 2021 at 7:50 am #101459
davout
MemberWhat value is meant to be set for a DateTimePicker control when using Angular reactive forms and the ‘setValue’ method?
February 9, 2021 at 7:54 am #101460admin
KeymasterHi davout,
The DatetimePicker works with Javascript date objects.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/February 9, 2021 at 8:56 am #101461davout
MemberDo I pass ‘null’ as the value if I want to have the datepicker start with no date displayed?
By default, it seems that the data picker is showing today’s dateFebruary 9, 2021 at 3:23 pm #101464yavordashew
MemberHi davout,
If you set datepicker’s value to null the input where the date is displayed will not display the current date but it will have placeholder with the text ‘Enter Date’.
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/February 10, 2021 at 5:40 pm #101473davout
MemberI am setting the react form value to null but the datepicker is showing today’s date
<smart-date-time-picker id="scheduledStart" autoclose="true" calendar-button down-position="bottom" dropDownDisplayMode="calendar" formatString="dd-MMM-yyyy" placeholder="From" [autoClose]="true" formControlName="scheduledFrom" style="width: 150px"> </smart-date-time-picker>
February 11, 2021 at 8:33 am #101476yavordashew
MemberHi davout,
I have prepared a little code snippet to show you how to achieve the functionality you want:<smart-date-time-picker id="scheduledStart" autoclose="true" calendar-button down-position="bottom" dropDownDisplayMode="calendar" formatString="dd-MMM-yyyy" placeholder="From" [autoClose]="true" formControlName="scheduledFrom" style="width: 150px" [nullable]="true" [placeholder]="'YOUR PLACEHOLDER'" > </smart-date-time-picker>
Please, do not hesitate to contact us if you have any additional questions.
Best regards,
Yavor Dashev
Smart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.