AppointmentInfo.svelte 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <script lang="ts">
  2. import { extractDate } from '$lib/funcs';
  3. /**
  4. * The title of an event or booking.
  5. *
  6. * @type {string}
  7. */
  8. export let title: string = '';
  9. /**
  10. * The location of an event or booking.
  11. *
  12. * @type {string}
  13. */
  14. export let location: string = '';
  15. /**
  16. * A brief description of an event or booking.
  17. *
  18. * @type {string}
  19. */
  20. export let description: string = '';
  21. /**
  22. * Whether this is a confirmation message.
  23. *
  24. * @type {boolean}
  25. */
  26. export let isConfirmation: boolean = false;
  27. /**
  28. * The date of an event or booking.
  29. *
  30. * @type {Date}
  31. */
  32. export let date: Date = new Date();
  33. /**
  34. * The duration of an event or booking, in minutes.
  35. *
  36. * @type {number}
  37. */
  38. export let duration: number = 0;
  39. /**
  40. * The time at which the event or booking starts. This should be set to a string
  41. * representing HH:mm (e.g., "12:30").
  42. *
  43. * @type {string}
  44. */
  45. export let time: string = '';
  46. </script>
  47. <article class="bottom-margin">
  48. <h5>{title}</h5>
  49. <p><i>pin_drop</i> {location}</p>
  50. <p><i>description</i> {description}</p>
  51. <p><i>timer</i> {duration} Min.</p>
  52. {#if isConfirmation}
  53. <p><i>event</i> {extractDate(new Date(date))}</p>
  54. <p><i>schedule</i> {time}</p>
  55. {/if}
  56. </article>