JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Date & Time Pickers smart-date-time-picker and Angular reactive form setvalue

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #101459
    davout
    Member

    What value is meant to be set for a DateTimePicker control when using Angular reactive forms and the ‘setValue’ method?

    #101460
    admin
    Keymaster

    Hi davout,
    The DatetimePicker works with Javascript date objects.
    Best regards,
    Peter Stoev
    Smart UI Team
    https://www.htmlelements.com/

    #101461
    davout
    Member

    Do 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 date

    #101464
    yavordashew
    Member

    Hi 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/

    #101473
    davout
    Member

    I 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>
    

     
     

    #101476
    yavordashew
    Member

    Hi 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/

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.