@samline/date 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Day.js repository: https://github.com/iamkun/dayjs
19
19
  ## Table of Contents
20
20
 
21
21
  - [Installation](#installation)
22
- - [Browser and CDN](#browser-and-cdn)
22
+ - [CDN / Browser](#cdn--browser)
23
23
  - [Entrypoints](#entrypoints)
24
24
  - [Quick Start](#quick-start)
25
25
  - [API](#api)
@@ -47,39 +47,36 @@ yarn add @samline/date
47
47
  bun add @samline/date
48
48
  ```
49
49
 
50
- ## Browser and CDN
50
+ ## CDN / Browser
51
51
 
52
- If your project does not use a bundler, load the browser build from a CDN. Prefer pinning a version instead of using `latest` in production.
52
+ Use the browser bundle when your project loads scripts directly in the page and cannot compile npm modules.
53
53
 
54
- ```html
55
- <script type="module">
56
- import { DateKit } from 'https://cdn.jsdelivr.net/npm/@samline/date@2.1.1/dist/browser/global.js'
57
-
58
- const value = await DateKit.getDate({
59
- date: '23/03/2026',
60
- input: 'DD/MM/YYYY',
61
- output: 'MMMM D, YYYY'
62
- })
54
+ This is useful in environments such as Shopify themes, WordPress templates, or plain HTML pages with no build step.
63
55
 
64
- console.log(value)
65
- console.log(window.DateKit.resolveLocale('en-us'))
66
- </script>
56
+ ```html
57
+ <script src="https://cdn.jsdelivr.net/npm/@samline/date@2.1.2/dist/browser/date.global.js"></script>
67
58
  ```
68
59
 
69
- You can also use unpkg:
60
+ Then use it from a normal script:
70
61
 
71
62
  ```html
72
- <script type="module">
73
- import { DateKit } from 'https://unpkg.com/@samline/date@2.1.1/dist/browser/global.js'
74
-
75
- console.log(await DateKit.isValidDate({
76
- date: '23/03/2026',
77
- input: 'DD/MM/YYYY'
78
- }))
63
+ <script>
64
+ ;(async () => {
65
+ const value = await window.DateKit.getDate({
66
+ date: '23/03/2026',
67
+ input: 'DD/MM/YYYY',
68
+ output: 'MMMM D, YYYY'
69
+ })
70
+
71
+ console.log(value)
72
+ console.log(window.DateKit.resolveLocale('en-us'))
73
+ })()
79
74
  </script>
80
75
  ```
81
76
 
82
- The browser bundle exposes `window.DateKit` and the same shared helpers documented below.
77
+ After the CDN script loads, the browser build exposes `window.DateKit`.
78
+
79
+ Use one of the package manager commands above when your project has a build step. If you are working in Shopify, WordPress, or any browser-only template without compilation, use the browser bundle described in [docs/browser.md](docs/browser.md).
83
80
 
84
81
  ## Entrypoints
85
82