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:
Krzysztof Kotlarek 2024-03-20 11:28:45 +11:00 committed by GitHub
parent 8180770e7b
commit 7f3f07dd40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -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) {

View File

@ -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