Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
El argumento de tipo 'número' no se puede asignar al parámetro de tipo 'Fecha'

Estoy tratando de probar una función pasando una fecha como parámetro a una función, pero no estoy seguro de dónde me estoy equivocando. Da un error de "El argumento de tipo 'número' no se puede asignar al parámetro de tipo 'Fecha'". cuando el código está estructurado de esta manera:

 import { Component, OnInit } from '@angular/core'; import { DamageAssessmentReportService } from 'src/app/damage-assessment-report.service'; @Component({ selector: 'app-fa-daform', templateUrl: './fa-daform.component.html', styleUrls: ['./fa-daform.component.css'] }) export class FADAFormComponent implements OnInit { constructor(private damageAssessmentReportService : DamageAssessmentReportService) { } //assessmentDescription: string, author: string, reportDateTime: Date createNewDAReport(){ this.damageAssessmentReportService.createDAReport('Testing1','Testing2', 2022-10-10).subscribe(()=>{ }) } ngOnInit(): void { } }

Pero los cambios a "Argumento de tipo 'cadena' no se pueden asignar a parámetros de tipo 'Fecha'.ts(2345)" cuando el código se cambia a:

 import { Component, OnInit } from '@angular/core'; import { DamageAssessmentReportService } from 'src/app/damage-assessment-report.service'; @Component({ selector: 'app-fa-daform', templateUrl: './fa-daform.component.html', styleUrls: ['./fa-daform.component.css'] }) export class FADAFormComponent implements OnInit { constructor(private damageAssessmentReportService : DamageAssessmentReportService) { } //assessmentDescription: string, author: string, reportDateTime: Date createNewDAReport(){ this.damageAssessmentReportService.createDAReport('Testing1','Testing2', '2022-10-10').subscribe(()=>{ }) } ngOnInit(): void { } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

createDAReport está esperando un objeto de fecha .

 this.damageAssessmentReportService.createDAReport('Testing1','Testing2', new Date(2020, 9, 10)).subscribe(() => { ... });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!