|
297 | 297 | if (window.innerHeight < containerTmp.getBoundingClientRect().bottom + 20) { |
298 | 298 | containerTmp.style.marginTop = - (containerTmp.getBoundingClientRect().height + this.inputField.getBoundingClientRect().height) + "px"; |
299 | 299 | } else { |
300 | | - containerTmp.style.marginTop = 'initial'; |
301 | | - } |
| 300 | + containerTmp.style.marginTop = 'initial'; |
| 301 | + } |
302 | 302 |
|
303 | 303 | this.processCalendar(); |
304 | 304 | }; |
|
653 | 653 | } |
654 | 654 | this.firstdayname = (this.params.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; |
655 | 655 |
|
656 | | - // Check if the direction is 'rtl' and reverse the shortDays array if true |
657 | | - if (this.params.direction === 'rtl') { |
658 | | - this.strings.shortDays.reverse(); |
659 | | - } |
| 656 | + // Check if the direction is 'rtl' and reverse the shortDays array if true |
| 657 | + if (this.params.direction === 'rtl') { |
| 658 | + this.strings.shortDays.reverse(); |
| 659 | + } |
660 | 660 |
|
661 | 661 | var fdow = this.params.firstDayOfWeek, |
662 | 662 | cell = this.firstdayname, |
|
697 | 697 | if (this.params.showsTime) { |
698 | 698 | row = createElement("tr", tbody); |
699 | 699 | row.className = "time"; |
| 700 | + row.classList.add('calendar-time-row'); // New: mark row for LTR |
700 | 701 |
|
701 | 702 | var cell = createElement("td", row); |
702 | 703 | cell.className = "time time-title"; |
703 | 704 | cell.colSpan = 1; |
704 | 705 | cell.style.verticalAlign = 'middle'; |
705 | 706 | cell.innerHTML = " "; |
706 | 707 |
|
707 | | - var cell1 = createElement("td", row); |
708 | | - cell1.className = "time hours-select"; |
709 | | - cell1.colSpan = self.params.time24 ? 3 : 2; |
| 708 | + var hoursCell = createElement("td", row); |
| 709 | + hoursCell.className = "time hours-select"; |
| 710 | + hoursCell.colSpan = self.params.time24 ? 3 : 2; |
710 | 711 |
|
711 | | - var cell2 = createElement("td", row); |
712 | | - cell2.className = "time minutes-select"; |
713 | | - cell2.colSpan = self.params.time24 ? 3 : 2; |
| 712 | + var minutesCell = createElement("td", row); |
| 713 | + minutesCell.className = "time minutes-select"; |
| 714 | + minutesCell.colSpan = self.params.time24 ? 3 : 2; |
| 715 | + |
| 716 | + // Swap DOM order in RTL so visual order remains Hours | Minutes |
| 717 | + if (this.params.direction === 'rtl') { |
| 718 | + row.insertBefore(minutesCell, hoursCell); |
| 719 | + } |
714 | 720 |
|
715 | 721 | (function () { |
716 | 722 | function makeTimePart(className, selected, range_start, range_end, cellTml) { |
|
746 | 752 | hrs -= 12; |
747 | 753 | } |
748 | 754 |
|
749 | | - var H = makeTimePart("time time-hours form-control form-select", hrs, t12 ? 1 : 0, t12 ? 12 : 23, cell1), |
750 | | - M = makeTimePart("time time-minutes form-control form-select", mins, 0, 59, cell2), |
| 755 | + var H = makeTimePart("time time-hours form-control form-select", hrs, t12 ? 1 : 0, t12 ? 12 : 23, hoursCell), |
| 756 | + M = makeTimePart("time time-minutes form-control form-select", mins, 0, 59, minutesCell), |
751 | 757 | AP = null; |
752 | 758 |
|
753 | 759 |
|
|
1113 | 1119 |
|
1114 | 1120 | for (var i = 0; i < elements.length; i++) { |
1115 | 1121 | var element = elements[i], |
1116 | | - instance = element._joomlaCalendar; |
| 1122 | + instance = element._joomlaCalendar; |
1117 | 1123 |
|
1118 | 1124 | if (instance) { |
1119 | 1125 | instance.setAltValue(); |
|
0 commit comments