apn.component.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { Component, OnInit, Input } from "@angular/core";
  2. import { InstrumentComponent } from "@app/components/investment-proposals/instrument/instrument.component";
  3. import { FormBuilder, FormGroup, Validators } from "@angular/forms";
  4. import { IAngularMyDpOptions, IMyDateModel } from "angular-mydatepicker";
  5. import { formatDate, DatePipe } from "@angular/common";
  6. @Component({
  7. selector: "app-apn",
  8. templateUrl: "./apn.component.html"
  9. })
  10. export class APNComponent implements InstrumentComponent {
  11. title: string = "Acciones preferentes nacionales";
  12. @Input() data: any;
  13. form: any;
  14. // For daterange
  15. daysLabels: any = {
  16. su: "Dom",
  17. mo: "Lun",
  18. tu: "Mar",
  19. we: "Mie",
  20. th: "Jue",
  21. fr: "Vie",
  22. sa: "Sab"
  23. };
  24. monthsLabels: any = {
  25. 1: "Ene",
  26. 2: "Feb",
  27. 3: "Mar",
  28. 4: "Abr",
  29. 5: "May",
  30. 6: "Jun",
  31. 7: "Jul",
  32. 8: "Ago",
  33. 9: "Sep",
  34. 10: "Oct",
  35. 11: "Nov",
  36. 12: "Dic"
  37. };
  38. investmentProposalForm: FormGroup;
  39. myDpOptions: IAngularMyDpOptions = {
  40. dateRange: false,
  41. dateFormat: "dd/mm/yyyy",
  42. dayLabels: this.daysLabels,
  43. monthLabels: this.monthsLabels
  44. };
  45. myDateInit: boolean = true;
  46. model: IMyDateModel = null;
  47. constructor(private formBuilder: FormBuilder) {
  48. console.log("init");
  49. this.investmentProposalForm = this.formBuilder.group({
  50. valor_nominal: ["", Validators.required],
  51. plazo_dias: ["", Validators.required],
  52. casa: ["", Validators.required],
  53. base_dias: ["", Validators.required],
  54. fecha_operacion: ["", Validators.required],
  55. fecha_liquidacion: ["", Validators.required],
  56. fecha_rendencion: ["", Validators.required]
  57. });
  58. }
  59. }