FIX: missing IST KST and JST timezones in cooked posts (#26252)
In this PR we introduced 3 new timezones to UX - IST, KST and JST
cb2569303f
However, the same has to be done in PrettyText so cooked posts respect those timezones.
This commit is contained in:
parent
8180770e7b
commit
7f3f07dd40
|
@ -1,5 +1,6 @@
|
|||
import { parseBBCodeTag } from "pretty-text/engines/discourse-markdown/bbcode-block";
|
||||
|
||||
moment.tz.link(["Asia/Kolkata|IST", "Asia/Seoul|KST", "Asia/Tokyo|JST"]);
|
||||
const timezoneNames = moment.tz.names();
|
||||
|
||||
function addSingleLocalDate(buffer, state, config) {
|
||||
|
|
|
@ -30,6 +30,15 @@ RSpec.describe "Local Dates" do
|
|||
|
||||
expect(cooked).to include('data-timezone="Asia/Calcutta"')
|
||||
expect(cooked).to include("05/08/2018 4:30:00 PM")
|
||||
|
||||
post = Fabricate(:post, raw: <<~MD)
|
||||
[date=2018-05-08 time=22:00 format="L LTS" timezone="IST"]
|
||||
MD
|
||||
|
||||
cooked = post.cooked
|
||||
|
||||
expect(cooked).to include('data-timezone="IST"')
|
||||
expect(cooked).to include("05/08/2018 4:30:00 PM")
|
||||
end
|
||||
|
||||
it "requires the right attributes to convert to a local date" do
|
||||
|
|
Loading…
Reference in New Issue