simon-void / pikaday_datepicker_angular2

provides a datepicker as Angular2 component
Other
5 stars 6 forks source link

only Init update two way variable "day" #2

Closed SadovovAlex closed 7 years ago

SadovovAlex commented 7 years ago

Hi

only Init update two way variable "day": if i set variable in init variable `class AppComponent_export1c implements OnInit { final Router _router; AppComponent_export1c(this._router);

DateTime DateFrom = new DateTime.now(); `

all ok

but if i set it on click button, is not set in pikaday=(

template


  <div class="col-lg-6  col-sm-6">
                                <label>Дата с:</label>
                                <pikaday cssClasses="form-control input-sm" [(day)]="DateFrom" format="DD-MM-YYYY"
                                         minDate="2017-01-01" maxDate="2025-12-31"
                                         firstDay="1">
                                </pikaday>
                                {{DateFrom}}
                            </div>

 <button class="btn btn-primary" title="zzzzz" (click)="onClickView()">
                            <span >zzzzz</span>
</button>

dart onClickView() async { DateTime today = new DateTime.now(); DateFrom = new DateTime(today.year, today.month-1, 1); print("Datefrom=" + DateFrom.toString() ); }

`

where i mistake?

PS var {{DateFrom}} in a template is set OK

simon-void commented 7 years ago

and your pikaday-invocation looks like this?

<pikaday [(day)]="DateFrom">

 

Gesendet: Montag, 22. Mai 2017 um 09:00 Uhr Von: Alex notifications@github.com An: simon-void/pikaday_datepicker_angular2 pikaday_datepicker_angular2@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Betreff: [simon-void/pikaday_datepicker_angular2] only Init update two way variable "day" (#2)

Hi

only Init update two way variable "day": if i set variable in init variable `class AppComponent_export1c implements OnInit { final Router _router; AppComponent_export1c(this._router);

DateTime DateFrom = new DateTime.now(); `

all ok

but if i set it on click button, is not set in pikaday=(

` template

Дата с: {{DateFrom}}

<button class="btn btn-primary" title="zzzzz" (click)="onClickView()"> zzzzz

dart onClickView() async { DateTime today = new DateTime.now(); DateFrom = new DateTime(today.year, today.month-1, 1); print("Datefrom=" + DateFrom.toString() ); }

`

where i mistake?

PS var {{DateFrom}} in a template is set OK

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

 

SadovovAlex commented 7 years ago

oh, not paste all template

<label>Дата с:</label>
                                <pikaday cssClasses="form-control input-sm" [(day)]="DateFrom" format="DD-MM-YYYY"
                                         minDate="2017-01-01" maxDate="2025-12-31"
                                         firstDay="1">
                                </pikaday>
                                {{DateFrom}}
simon-void commented 7 years ago

I'm working on fixing that. Maybe today, maybe on wednesday.

 

/Stephan

 

Gesendet: Montag, 22. Mai 2017 um 09:42 Uhr Von: Alex notifications@github.com An: simon-void/pikaday_datepicker_angular2 pikaday_datepicker_angular2@noreply.github.com Cc: "Stephan Schröder" simon.void@gmx.de, Comment comment@noreply.github.com Betreff: Re: [simon-void/pikaday_datepicker_angular2] only Init update two way variable "day" (#2)

oh, not paste all template

{{DateFrom}} — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.  
simon-void commented 7 years ago

check out version 2.1.1