I am setting up a dialog box for an employee to select a starting and ending time of their work using the Amazing Time Picker (https://www.npmjs.com/package/amazing-time-picker). I have set up two input tags with two-way binding. When the user selects the second time, the other element changes. For example, I select 8AM as my start time, then select 12PM as my end time. When I select 12PM, the start time changes to 12PM instead of staying at 8AM.
Beyond not finding anything in my google searches about two-way data binding affecting multiple fields, I have messed with changing the properties. I did not go too far down that path because it would have required me to change multiple components. I am wondering if I have to do that though, but I wanted confirmation first.
// Here are the start and stop input tags...
<input name="startTime" id="startTime" class="form-control" atp-time-
picker type="time" [(ngModel)]="timestamp.date">
<input name="stopTime" id="stopTime" class="form-control" atp-time-picker type="time" [(ngModel)]="timestamp.date">
//The timestamp interface is just...
public date: Date;
I want the end user to select a start and stop time and not have them change each other. I am planning on capturing these timestamps and putting them into a timecard object. Just for reference, my timecard details interface is...
...
public timestamps: Array<Timestamp>;
...
public constructor() {
this.timestamps = new Array<Timestamp>();
}
These details will be put into an array and then into a timecard for the employee...
...
public timecardDets: Array<TimecardDet>;
...
public constructor() {
this.timecardDets = new Array<TimecardDet>();
}