mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:11:20 +08:00
FIX: Tooltip should use format option instead of defaulting to "LLL".
This commit is contained in:
@ -27,7 +27,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var previews = options.timezones.split("|").map(function(timezone) {
|
var previews = options.timezones.split("|").map(function(timezone) {
|
||||||
var dateTime = relativeTime.tz(timezone).format("LLL");
|
var dateTime = relativeTime
|
||||||
|
.tz(timezone)
|
||||||
|
.format(options.format || "LLL");
|
||||||
|
|
||||||
var timezoneParts = _formatTimezone(timezone);
|
var timezoneParts = _formatTimezone(timezone);
|
||||||
|
|
||||||
if (dateTime.match(/TZ/)) {
|
if (dateTime.match(/TZ/)) {
|
||||||
|
@ -4,15 +4,15 @@ describe PrettyText do
|
|||||||
it 'supports inserting date' do
|
it 'supports inserting date' do
|
||||||
freeze_time
|
freeze_time
|
||||||
cooked = PrettyText.cook <<~MD
|
cooked = PrettyText.cook <<~MD
|
||||||
[date=2018-05-08 time=22:00 format=LLL timezones="Europe/Paris|America/Los_Angeles"]
|
[date=2018-05-08 time=22:00 format="L LTS" timezones="Europe/Paris|America/Los_Angeles"]
|
||||||
MD
|
MD
|
||||||
|
|
||||||
expect(cooked).to include('class="discourse-local-date"')
|
expect(cooked).to include('class="discourse-local-date"')
|
||||||
expect(cooked).to include('data-date="2018-05-08"')
|
expect(cooked).to include('data-date="2018-05-08"')
|
||||||
expect(cooked).to include('data-format="LLL"')
|
expect(cooked).to include('data-format="L LTS"')
|
||||||
expect(cooked).to include('data-timezones="Europe/Paris|America/Los_Angeles"')
|
expect(cooked).to include('data-timezones="Europe/Paris|America/Los_Angeles"')
|
||||||
expect(cooked).to include('May 8, 2018 3:00 PM (America: Los Angeles)')
|
expect(cooked).to include('05/08/2018 3:00:00 PM (America: Los Angeles)')
|
||||||
expect(cooked).to include('May 9, 2018 12:00 AM (Europe: Paris)')
|
expect(cooked).to include('05/09/2018 12:00:00 AM (Europe: Paris)')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'uses a simplified syntax in emails' do
|
it 'uses a simplified syntax in emails' do
|
||||||
|
Reference in New Issue
Block a user