forked from fossasia/open-event-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Set moment locale according to chosen language (fossasia#5414)
- Loading branch information
1 parent
0993bec
commit 323c7ac
Showing
4 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const getScript = (url: string): Promise<void> => new Promise((resolve, reject) => { | ||
const script = document.createElement('script'); | ||
script.src = url; | ||
script.async = true; | ||
|
||
script.onerror = reject; | ||
|
||
script.onload = (script as any).onreadystatechange = function() { | ||
const loadState = this.readyState; | ||
|
||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') {return} | ||
|
||
script.onload = (script as any).onreadystatechange = null; | ||
|
||
resolve(); | ||
}; | ||
|
||
document.head.appendChild(script); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters