Skip to content

Commit

Permalink
docs: Add examples of complete application integrating this library
Browse files Browse the repository at this point in the history
  • Loading branch information
prantlf committed Jun 10, 2019
1 parent 5270606 commit 7954d0f
Show file tree
Hide file tree
Showing 29 changed files with 11,645 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
coverage
dist
examples/**/out
node_modules
src/lookup/data*.js
src/index-*.d.ts
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.gitignore
.npmignore
.vscode
examples
perf
rollup.config.js
test
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const { findTimeZone, getZonedTime } = require('timezone-support')

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.

You can see [complete sample applications] too, which can help you start with integration of this library.

## Library Integrations

* [Day.js] - [timeZone plugin] supplies parsing from and formatting to an arbitrary time zone
Expand Down Expand Up @@ -113,3 +115,4 @@ Licensed under the MIT license.
[timeZone plugin]: https://github.com/prantlf/dayjs/blob/combined/docs/en/Plugin.md#timezone
[date-fns-timezone]: https://github.com/prantlf/date-fns-timezone
[migration guide]: docs/migration.md#migration-from-1x-to-2x
[complete sample applications]: examples#readme
21 changes: 21 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Time Zone Support Usage Examples

Buildable JavaScript projects demonstrating how to integrate `timezone-support`. [Rollup.js] builds the project output.

## [Separate from a Browser Apoplication]

Demonstrates how to load timezone-support as a separate script in the browser, with either complete or limited time zone data.

## [Bundled to a Browser Apoplication]

Demonstrates how to compile timezone-support to your application script bundle and load in the browser, with either complete or limited time zone data.

## [Used in a Node.js Apoplication]

Demonstrates how to use timezone-support in a [Node.js] application, with either complete or limited time zone data.

[Node.js]: https://nodejs.org/
[Rollup.js]: https://rollupjs.org/
[Separate from a Browser Apoplication]: ./browser-separate/#readme
[Bundled to a Browser Apoplication]: ./browser-bundled/#readme
[Used in a Node.js Apoplication]: ./nodejs/#readme
10 changes: 10 additions & 0 deletions examples/browser-bundled/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@babel/preset-env",
{
"loose": true
}
]
]
}
9 changes: 9 additions & 0 deletions examples/browser-bundled/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
7 changes: 7 additions & 0 deletions examples/browser-bundled/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Time Zone Support Bundled to a Browser Apoplication

Buildable JavaScript projects demonstrating how to integrate `timezone-support`. [Rollup.js] builds the project output.

Demonstrates how to compile timezone-support to your application script bundle and load in the browser, with either complete or limited time zone data.

[Rollup.js]: https://rollupjs.org/
Loading

0 comments on commit 7954d0f

Please sign in to comment.