You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.4 KiB

  1. <template>
  2. <div class="calendar-wrapper">
  3. <div>
  4. <label for=""> Local Airline </label>
  5. <h1>
  6. {{ selectedSchedule.Carrier_Name }}
  7. </h1>
  8. </div>
  9. <div>
  10. <label for=""> Departs </label>
  11. <div>
  12. {{ selectedSchedule.Departure_TimeL }}
  13. </div>
  14. </div>
  15. <div>
  16. <label for=""> Arrives </label>
  17. <div>
  18. {{ selectedSchedule.Arrival_TimeL }}
  19. </div>
  20. </div>
  21. <div>
  22. <label for=""> Available Until </label>
  23. <div>
  24. {{ selectedSchedule.Effective_End }}
  25. </div>
  26. </div>
  27. <div>
  28. <label for="">How Many Adults?</label>
  29. <v-select
  30. v-model="numAdult"
  31. :options="[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
  32. />
  33. </div>
  34. <div>
  35. <label for="">How Many Children?</label>
  36. <v-select
  37. v-model="numChild"
  38. :options="[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
  39. />
  40. </div>
  41. <Calendar
  42. v-for="date in startingDates"
  43. :key="date.toString()"
  44. :date="new Date(date)"
  45. :selected-days="selectedDays"
  46. @book="book"
  47. />
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. props: {
  53. startingDate: {
  54. type: [Date],
  55. default () {
  56. return new Date()
  57. }
  58. },
  59. selectedSchedule: {
  60. type: [Object],
  61. default () {
  62. return {}
  63. }
  64. },
  65. selectedDays: {
  66. type: [Array],
  67. default () {
  68. return []
  69. }
  70. }
  71. },
  72. data () {
  73. return {
  74. numberOfMonths: 4,
  75. numAdult: 1,
  76. numChild: 0
  77. }
  78. },
  79. computed: {
  80. startingDates () {
  81. const listOfDates = []
  82. for (let index = 0; index < this.numberOfMonths; index++) {
  83. const thisDate = new Date(this.startingDate.getFullYear(), this.startingDate.getMonth() + index, 1)
  84. listOfDates.push(thisDate)
  85. }
  86. return listOfDates
  87. }
  88. },
  89. methods: {
  90. book (thisDate) {
  91. window.open(`https://www.anrdoezrs.net/links/100449149/type/am/https://www.expedia.com/go/flight/search/oneway/${this.formatDate(thisDate)}/${this.formatDate(thisDate)}?langid=1033&FromAirport=${this.selectedSchedule.Origin_IATA}&FromTime=${this.selectedSchedule.Departure_TimeL}&ToTime=${this.selectedSchedule.Arrival_TimeL}&ToAirport=${this.selectedSchedule.Destination_IATA}&Class=3&NumAdult=${this.numAdult}&NumChild=${this.numChild}`)
  92. },
  93. formatDate (thisDate) {
  94. return thisDate.toLocaleDateString('en-CA')
  95. }
  96. }
  97. }
  98. </script>
  99. <style>
  100. .calendar-wrapper {
  101. color: black;
  102. }
  103. </style>