Commit 896f8db
fix: align booking limit timezone between availability and validation (calcom#24846)
* fix: align booking limit timezone between availability and validation
- Use eventType.schedule?.timeZone for booking limits in availability calculation
- Previously used user's timezone causing day boundary mismatch
- Add unit tests to verify timezone alignment
- Fixes issue where slots remain available after reaching booking limit
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Rename variable limitsTz to eventTimeZone
* update
* fix: correct timezone fallback to include user timezone without forcing UTC
- Changed fallback chain to: schedule → event → user → undefined
- Treats empty strings as missing timezones
- Does not force UTC when all timezones are missing
- Aligns with validation behavior when timezone is undefined
- Fixes getSchedule.test.ts failures
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* Revert "fix: correct timezone fallback to include user timezone without forcing UTC"
This reverts commit 721e0bd.
* test: remove complex unit tests with 'as any' casts
- Removed Booking Limits Timezone Alignment tests that required heavy mocking
- These tests relied on spying private methods and had many 'as any' casts
- Timezone alignment is already covered by integration tests in getSchedule.test.ts
- Kept BookingDateInPastError test which has no type issues
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* address review
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent f1db27c commit 896f8db
2 files changed
Lines changed: 101 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2735 | 2735 | | |
2736 | 2736 | | |
2737 | 2737 | | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
2738 | 2835 | | |
2739 | 2836 | | |
2740 | 2837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
826 | 827 | | |
827 | 828 | | |
828 | 829 | | |
| |||
831 | 832 | | |
832 | 833 | | |
833 | 834 | | |
834 | | - | |
| 835 | + | |
835 | 836 | | |
836 | 837 | | |
837 | 838 | | |
| |||
845 | 846 | | |
846 | 847 | | |
847 | 848 | | |
| 849 | + | |
848 | 850 | | |
849 | 851 | | |
850 | 852 | | |
851 | 853 | | |
852 | 854 | | |
853 | 855 | | |
854 | 856 | | |
855 | | - | |
| 857 | + | |
856 | 858 | | |
857 | 859 | | |
858 | 860 | | |
| |||
0 commit comments