Skip to content

Commit 7954d0f

Browse files
committed
docs: Add examples of complete application integrating this library
1 parent 5270606 commit 7954d0f

29 files changed

Lines changed: 11645 additions & 0 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
coverage
33
dist
4+
examples/**/out
45
node_modules
56
src/lookup/data*.js
67
src/index-*.d.ts

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.gitignore
44
.npmignore
55
.vscode
6+
examples
67
perf
78
rollup.config.js
89
test

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ const { findTimeZone, getZonedTime } = require('timezone-support')
7474

7575
You can read more about the [module loading](./docs/API.md#loading) in other environments, like with ES6 or in web browsers. [Usage scenarios](./docs/usage.md#usage-scenarios) demonstrate applications of this library in typical real-world scenarios. [Design concepts](./docs/design.md#design-concepts) explain the approach to time zone handling taken by tni library and types of values used ion the interface. [Generating custom time zone data](./docs/usage.md#generate-custom-time-zone-data) will allow you to save the overall package size by limiting the supported year span. Finally, the [API reference](./docs/API.md#api-reference) lists all functions with a description of their functionality.
7676

77+
You can see [complete sample applications] too, which can help you start with integration of this library.
78+
7779
## Library Integrations
7880

7981
* [Day.js] - [timeZone plugin] supplies parsing from and formatting to an arbitrary time zone
@@ -113,3 +115,4 @@ Licensed under the MIT license.
113115
[timeZone plugin]: https://github.com/prantlf/dayjs/blob/combined/docs/en/Plugin.md#timezone
114116
[date-fns-timezone]: https://github.com/prantlf/date-fns-timezone
115117
[migration guide]: docs/migration.md#migration-from-1x-to-2x
118+
[complete sample applications]: examples#readme

examples/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Time Zone Support Usage Examples
2+
3+
Buildable JavaScript projects demonstrating how to integrate `timezone-support`. [Rollup.js] builds the project output.
4+
5+
## [Separate from a Browser Apoplication]
6+
7+
Demonstrates how to load timezone-support as a separate script in the browser, with either complete or limited time zone data.
8+
9+
## [Bundled to a Browser Apoplication]
10+
11+
Demonstrates how to compile timezone-support to your application script bundle and load in the browser, with either complete or limited time zone data.
12+
13+
## [Used in a Node.js Apoplication]
14+
15+
Demonstrates how to use timezone-support in a [Node.js] application, with either complete or limited time zone data.
16+
17+
[Node.js]: https://nodejs.org/
18+
[Rollup.js]: https://rollupjs.org/
19+
[Separate from a Browser Apoplication]: ./browser-separate/#readme
20+
[Bundled to a Browser Apoplication]: ./browser-bundled/#readme
21+
[Used in a Node.js Apoplication]: ./nodejs/#readme

examples/browser-bundled/.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"loose": true
7+
}
8+
]
9+
]
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

examples/browser-bundled/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Time Zone Support Bundled to a Browser Apoplication
2+
3+
Buildable JavaScript projects demonstrating how to integrate `timezone-support`. [Rollup.js] builds the project output.
4+
5+
Demonstrates how to compile timezone-support to your application script bundle and load in the browser, with either complete or limited time zone data.
6+
7+
[Rollup.js]: https://rollupjs.org/

0 commit comments

Comments
 (0)