Skip to content

Commit d4c8c95

Browse files
committed
Merge branch 'master' into new-react-docs-only
2 parents b68388e + 0aa2e21 commit d4c8c95

File tree

201 files changed

+24592
-10789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+24592
-10789
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ out
44
*.swp
55
*.swo
66

7-
*.bs.js
8-
97
# Generated via update-index script
108
public/blog/feed.xml
119

@@ -14,6 +12,7 @@ node_modules/
1412
index_data/*.json
1513
!index_data/blog_authors.json
1614
!index_data/blog_posts.json
15+
!index_data/build-schema.json
1716

1817
yarn-error.log
1918

@@ -23,3 +22,6 @@ lib/
2322
.vscode/
2423

2524
.vercel
25+
26+
# for IDE tooling tests
27+
bin.exe

_blogposts/2020-08-28-new-rescript-logo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |
88
Today, our resident designer Bettina is unveiling to us the fresh new ReScript branding we've been long waiting for. We hope you're as excited about the result as us!
99
---
1010

11-
import Image from "components/Image.bs";
11+
import Image from "components/Image";
1212

1313
## Why the Rebranding?
1414

_blogposts/archive/state-of-reasonml-org-2020-q2-pt1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: |
1010
to expect in the future. The first part is an introduction to our project.
1111
---
1212

13-
import Image from "components/Image.bs";
13+
import Image from "components/Image";
1414

1515
## Hello World!
1616

_blogposts/archive/state-of-reasonml-org-2020-q2-pt3.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: |
99
talk about upcoming tools and features.
1010
---
1111

12-
import Image from "components/Image.bs";
12+
import Image from "components/Image";
1313

1414
## Future Tools for the Community
1515

_blogposts/archive/state-of-reasonml-org-2020-q2-pt4.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: |
1010
This is the final part of the series about our vision of a more accessible Reason platform.
1111
---
1212

13-
import Image from "components/Image.bs";
13+
import Image from "components/Image";
1414

1515
## It's all Opinions
1616

bindings/IntlDateTimeFormat.js

Lines changed: 143 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/IntlDateTimeFormat.re

Lines changed: 0 additions & 83 deletions
This file was deleted.

bindings/IntlDateTimeFormat.res

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
type intl
2+
3+
/* Supported locales */
4+
@bs.deriving({jsConverter: newType})
5+
type locale = [@bs.as("zh") #CH | @bs.as("ru-RU") #RUS | @bs.as("sv-SE") #SWE | @bs.as("en-US") #US]
6+
7+
module Date = {
8+
module Weekday = {
9+
@bs.deriving({jsConverter: newType})
10+
type t = [#long | #short | #narrow]
11+
12+
let make = value => tToJs(value)
13+
}
14+
15+
module Era = {
16+
@bs.deriving({jsConverter: newType})
17+
type t = [#long | #short | #narrow]
18+
19+
let make = value => tToJs(value)
20+
}
21+
22+
module Year = {
23+
@bs.deriving({jsConverter: newType})
24+
type t = [#numeric | @bs.as("2-digit") #twoDigit]
25+
26+
let make = value => tToJs(value)
27+
}
28+
29+
module Day = {
30+
@bs.deriving({jsConverter: newType})
31+
type t = [#numeric | @bs.as("2-digit") #twoDigit]
32+
33+
let make = value => tToJs(value)
34+
}
35+
36+
module Month = {
37+
/* Helper for month option */
38+
@bs.deriving({jsConverter: newType})
39+
type t = [#long | #short | #narrow | #numeric | @bs.as("2-digit") #twoDigit]
40+
41+
let make = value => tToJs(value)
42+
}
43+
44+
/* Options for Intl.DateTimeFormat */
45+
@bs.deriving(abstract)
46+
type options = {
47+
@bs.optional
48+
weekday: Weekday.abs_t,
49+
@bs.optional
50+
era: Era.abs_t,
51+
@bs.optional
52+
year: Year.abs_t,
53+
@bs.optional
54+
day: Day.abs_t,
55+
@bs.optional
56+
month: Month.abs_t,
57+
}
58+
59+
/*
60+
Intl.DateTimeFormat
61+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat
62+
*/
63+
@bs.new @bs.scope("Intl")
64+
external dateTimeFormat: (abs_locale, option<options>) => intl = "DateTimeFormat"
65+
66+
/* Intl.DateTimeFormat.prototype.format() */
67+
@bs.send external format: (intl, Js.Date.t) => string = "format"
68+
69+
let make = (~locale=#US, ~options=?, date) =>
70+
dateTimeFormat(localeToJs(locale), options)->format(date)
71+
}

0 commit comments

Comments
 (0)