Base solution for your next web application
Open Closed

abp-datetime-picker display issue when setting value #12574


User avatar
0
ips-ad created

Hi, we're using abp-datetime-picker like this:

<abp-datetime-picker
    [bsConfig]="{ adaptivePosition: true }"
    [(ngModel)]="fristDatum"
    id="Frist_FristDatum"
    name="Frist_FristDatum"
    required
    [disabled]="frist.id && frist.fristTyp == 'F'" />

this.fristDatum is initialized with this.fristDatum = DateTime.local();. In this modal, we may change this.fristDatum programatically according to some calculations, which we then set like this to create a safe, clean new value: this.fristDatum = DateTime.local(this.fristDatum.year, this.fristDatum.month, this.fristDatum.day, 0, 0, 0);

The picker shows it correctly:

But this works only once, the second time we change it the date is not being displayed correctly anymore, but looks like this:

Can you please check why it's behaving like this and what we can do to fix it? Thanks!

We are using Zero 14.2.1 (Angular).

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @ips-ad

    Have you tried assigning a date-time to the Date property using the DateTimeService in the ngOnInit phase, as in demo-ui-date-time.component.ts? You can find the sample code at this link.

    date-time.service.ts

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)