Skip to content

Commit 0e0ef06

Browse files
Rough RTL support
1 parent 6e1b2c6 commit 0e0ef06

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ <h3>Download</h3>
106106
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
107107
.ui-timepicker-div td { font-size: 90%; }
108108
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
109+
110+
.ui-timepicker-rtl{ direction: rtl; }
111+
.ui-timepicker-rtl dl { text-align: right; }
112+
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
109113
</pre>
110114

111115
<h3>Requirements</h3>

jquery-ui-timepicker-addon.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
55
.ui-timepicker-div td { font-size: 90%; }
66
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
7+
8+
.ui-timepicker-rtl{ direction: rtl; }
9+
.ui-timepicker-rtl dl { text-align: right; }
10+
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }

jquery-ui-timepicker-addon.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
minuteText: 'Minute',
6262
secondText: 'Second',
6363
millisecText: 'Millisecond',
64-
timezoneText: 'Time Zone'
64+
timezoneText: 'Time Zone',
65+
isRTL: false
6566
};
6667
this._defaults = { // Global defaults for all the datetime picker instances
6768
showButtonPanel: true,
@@ -326,7 +327,7 @@
326327
// Prevent displaying twice
327328
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
328329
var noDisplay = ' style="display:none;"',
329-
html = '<div class="ui-timepicker-div"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
330+
html = '<div class="ui-timepicker-div'+ (o.isRTL? ' ui-timepicker-rtl' : '') +'"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
330331
'<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
331332

332333
// Create the markup

0 commit comments

Comments
 (0)