title: MomentJS changing value when assigned to new variable
body: <p>When I try assigning a moment to a new variable it changes the value without me modifying it.</p>
  
  <p>I have tried everything from forcing the use of UTC and settings timezones. It just keeps changing the value.</p>
  
  <pre><code>@Component({
    selector: 'app-appointment-create',
    templateUrl: './appointment-create.component.html',
    styleUrls: ['./appointment-create.component.css']
  })
  export class AppointmentCreateComponent implements OnInit {
  
    appointment: CreateAppointmentDto;
    form: FormGroup;
    private formSubmitted: boolean;
    tasks: Task[];
    availability: Availability[];
    task: number;
    availablemoments: Moment[];
  
    constructor(
      private titleService: Title,
      private router: Router,
      private appointmentService: AppointmentService,
      private taskService: TasksService,
      private webLogger: WebloggerService,
      private availabilityService: AvailabilityService,
    ) {
      this.appointment = new CreateAppointmentDto();
    }
  
    dateFilter = (d: Moment): boolean =&gt; {
      return this.availability.filter(s =&gt; s.timestampstart.isSame(d, 'day')).length &gt;= 1;
    }
  
    ngOnInit() {
      this.titleService.setTitle('New Appointment');
  
      this.taskService.getActiveTasks().subscribe(value =&gt; {this.tasks = value; });
  
      this.form = new FormGroup({
        timestampstart: new FormControl(this.appointment.timestampstart, Validators.required),
        daystart: new FormControl(this.appointment.timestampstart, Validators.required),
        location: new FormControl(this.appointment.location, Validators.required),
        description: new FormControl(this.appointment.description, Validators.required),
        paid: new FormControl(false, Validators.required),
        serviceType: new FormControl(this.appointment.serviceTypeId, Validators.required),
        client: new FormControl(this.appointment.clientId, Validators.required),
        assignedUser: new FormControl(this.appointment.assignedUserId, Validators.required),
      });
    }
  
    onSubmit(event) {
      event.preventDefault();
      this.formSubmitted = true;
  
      if (this.form.valid) {
        this.form.disable();
        this.appointment.timestampstart = this.form.get('timestampstart').value;
        this.appointment.location = this.form.get('location').value;
        this.appointment.description = this.form.get('description').value;
        this.appointment.paid = this.form.get('paid').value;
        this.appointment.serviceTypeId = this.form.get('serviceType').value;
        this.appointment.clientId = this.form.get('client').value;
        this.appointment.assignedUserId = this.form.get('assignedUser').value;
        this.appointmentService.createNewAppointment(this.appointment)
          .subscribe(value =&gt; { this.router.navigate([`/dashboard/appointment/${value.id}/edit`]); });
      } else {
        this.webLogger.error('The form is invalid, please check the values');
      }
    }
  
    selectTask($event: Event) {
      this.task = Number(this.form.get('serviceType').value);
      this.availabilityService.getAvailabilityForTask(this.task).subscribe(value =&gt; {
        this.availability = value;
      });
    }
  
    setTime($event: Event) {
      this.availablemoments = [];
      const dayAvailability: Availability[] = this.availability.filter(
        s =&gt; s.timestampstart.isSame(moment(this.form.get('daystart').value), 'day'));
      const currentDate = dayAvailability.reduce((prev, curr) =&gt; prev.timestampstart &lt; curr.timestampstart ? prev : curr).timestampstart;
      dayAvailability.forEach(value =&gt; {
        while (value.timestampend.isAfter(currentDate)) {
          if (!this.availablemoments.includes(moment(currentDate))) {
            this.availablemoments.push(moment(currentDate));
          }
          currentDate.add(30, 'minutes');
        }
      });
    }
  }
  </code></pre>
  
  <p>this.availability is a list of Availability objects which include start and end moments</p>
  
  <p>I expect the second console log to return the same as the first console log.</p>
  
  <p>UPDATE:</p>
  
  <p>The Availability class looks like this:</p>
  
  <pre><code>export class Availability {
    id: number;
    timestampstart: Moment;
    timestampend: Moment;
    location: string;
    description: string;
    paid: boolean;
    payment: Invoice;
    serviceType: Task;
    client: Client;
    assignedUser: User;
  
    static serialize(data: any): Availability {
      const user: Availability = Object.assign(new this(), data);
      if (data.hasOwnProperty('timestampstart')) {
        user.timestampstart = moment(data.timestampstart);
      }
      if (data.hasOwnProperty('timestampend')) {
        user.timestampend = moment(data.timestampend);
      }
      if (data.hasOwnProperty('serviceType')) {
        user.serviceType = Task.serialize(data.serviceType);
      }
      if (data.hasOwnProperty('client')) {
        user.client = Client.serialize(data.client);
      }
      if (data.hasOwnProperty('assignedUser')) {
        user.assignedUser = User.serialize(data.assignedUser);
      }
      return user;
    }
  }
  </code></pre>