Skip to content

Commit

Permalink
6.2.10 (#2748)
Browse files Browse the repository at this point in the history
* fixes #2746
* fixed #2600 - when using plugin
* moved plugins and locales into the js folder to make TS happy
  • Loading branch information
Eonasdan authored Dec 22, 2022
1 parent 3414800 commit 1a3ff82
Show file tree
Hide file tree
Showing 68 changed files with 128 additions and 88 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Rate on Openbase](https://badges.openbase.com/js/rating/@eonasdan/tempus-dominus.svg)](https://openbase.com/js/@eonasdan/tempus-dominus?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)

# Tempus Dominus Date/Time Picker v6.2.9
# Tempus Dominus Date/Time Picker v6.2.10

Tempus Dominus is a powerful and robust date time picker for javascript. Version 6 is another major rewrite over the previous version. V6 is written with modern browsers in mind and is written in typescript. Bootstrap, momentjs and jQuery are no longer required dependencies. Popper2 is all that is required for the picker to position correctly. If you still require jQuery (seriously, you should move off that asap) there's a jQuery provider that wraps the native js functions.

Expand Down
12 changes: 6 additions & 6 deletions build/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');

const formatName = (n) => n.replace(/\.ts/, '').replace(/-/g, '_');

const localePath = path.join(__dirname, '../src/locales');
const localePath = path.join(__dirname, '../src/js/locales');

async function build(option) {
const bundle = await rollup.rollup(option.input);
Expand All @@ -22,7 +22,7 @@ async function locales() {
// run builds sequentially to limit RAM usage
await build(
genericRollup({
input: `./src/locales/${l}`,
input: `./src/js/locales/${l}`,
fileName: `./dist/locales/${l.replace('.ts', '.js')}`,
name: `tempusDominus.locales.${formatName(l)}`,
kind: 'locales',
Expand All @@ -37,12 +37,12 @@ async function locales() {
async function plugins() {
console.log('Building Plugins...');
try {
const plugins = await fs.readdir(path.join(__dirname, '../src/plugins'));
const plugins = await fs.readdir(path.join(__dirname, '../src/js/plugins'));
for (const plugin of plugins.filter((x) => x !== 'examples')) {
// run builds sequentially to limit RAM usage
await build(
genericRollup({
input: `./src/plugins/${plugin}/index.ts`,
input: `./src/js/plugins/${plugin}/index.ts`,
fileName: `./dist/plugins/${plugin}.js`,
name: `tempusDominus.plugins.${formatName(plugin)}`,
kind: 'plugins',
Expand All @@ -51,13 +51,13 @@ async function plugins() {
}

const examplePlugins = await fs.readdir(
path.join(__dirname, '../src/plugins/examples')
path.join(__dirname, '../src/js/plugins/examples')
);
for (const plugin of examplePlugins.map((x) => x.replace('.ts', ''))) {
// run builds sequentially to limit RAM usage
await build(
genericRollup({
input: `./src/plugins/examples/${plugin}.ts`,
input: `./src/js/plugins/examples/${plugin}.ts`,
fileName: `./dist/plugins/examples/${plugin}.js`,
name: `tempusDominus.plugins.${formatName(plugin)}`,
})
Expand Down
1 change: 0 additions & 1 deletion build/rollup-plugin.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = (config) => {
tsconfig: (resolvedConfig) => ({
...resolvedConfig,
declaration: kind !== undefined,
rootDir: './src',
declarationDir: `./types/${kind}`,
}),
}),
Expand Down
7 changes: 6 additions & 1 deletion dist/css/tempus-dominus.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/tempus-dominus.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/tempus-dominus.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jQuery-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*global $, tempusDominus */

/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2021 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/jQuery-provider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/js/tempus-dominus.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/tempus-dominus.esm.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/tempus-dominus.esm.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/js/tempus-dominus.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/tempus-dominus.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/tempus-dominus.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/locales/ar-SA.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/ar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/de.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/es.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/fi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/fr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/it.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/nl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/pl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/ro.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/ru.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/sl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/locales/tr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
13 changes: 10 additions & 3 deletions dist/plugins/customDateFormat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -259,6 +259,13 @@
const format = this.replaceTokens(this.localization.format ||
`${this.englishFormats.L}, ${this.englishFormats.LT}`, this.localization.dateFormats);
const formatter = (template) => new Intl.DateTimeFormat(this.localization.locale, template).format(dateTime);
//if the format asks for a twenty-four-hour string but the hour cycle is not, then make a base guess
const HHCycle = this.localization.hourCycle.startsWith('h1')
? 'h24'
: this.localization.hourCycle;
const hhCycle = this.localization.hourCycle.startsWith('h2')
? 'h12'
: this.localization.hourCycle;
const matches = {
yy: formatter({ year: '2-digit' }),
yyyy: dateTime.year,
Expand All @@ -271,9 +278,9 @@
ddd: formatter({ weekday: 'short' }),
dddd: formatter({ weekday: 'long' }),
H: dateTime.getHours(),
HH: dateTime.getHoursFormatted('h24'),
HH: dateTime.getHoursFormatted(HHCycle),
h: dateTime.hours > 12 ? dateTime.hours - 12 : dateTime.hours,
hh: dateTime.getHoursFormatted('h12'),
hh: dateTime.getHoursFormatted(hhCycle),
t: dateTime.meridiem(),
T: dateTime.meridiem().toUpperCase(),
m: dateTime.minutes,
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/fa-five.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/moment-parse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Tempus Dominus v6.2.9 (https://getdatepicker.com/)
* Tempus Dominus v6.2.10 (https://getdatepicker.com/)
* Copyright 2013-2022 Jonathan Peterson
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
*/
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Jonathan Peterson"
},
"name": "@eonasdan/tempus-dominus",
"version": "6.2.9",
"version": "6.2.10",
"style": "dist/css/tempus-dominus.css",
"sass": "scss/tempus-dominus.scss",
"main": "dist/js/tempus-dominus.js",
Expand All @@ -12,8 +12,8 @@
"files": [
"dist/**/*",
"src/js/**/*.ts",
"src/locales/**/*.ts",
"src/plugins/**/*.ts",
"src/js/locales/**/*.ts",
"src/js/plugins/**/*.ts",
"src/scss/**/*.scss",
"types/**/*"
],
Expand Down
9 changes: 9 additions & 0 deletions src/docs/partials/change-log.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
<div id='change-log'>
<h1>Version 6</h1>

<div class='row'>
<h2>6.2.10</h2>
<h3>Bug fixes</h3>
<ul>
<li>Can't change time & meridiem #2746</li>
<li>Fixed regression with #2600</li>
</ul>
</div>

<div class='row'>
<h2>6.2.9</h2>
<h3>Bug fixes</h3>
Expand Down
4 changes: 2 additions & 2 deletions src/docs/partials/installing.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ <h2 id='cdn'>Via CDN</h2>
<code class='language-html'>&lt;!-- Popperjs --&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;!-- Tempus Dominus JavaScript --&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/[email protected].9/dist/js/tempus-dominus.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/[email protected].10/dist/js/tempus-dominus.min.js&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;

&lt;!-- Tempus Dominus Styles --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/[email protected].9/dist/css/tempus-dominus.min.css&quot; crossorigin=&quot;anonymous&quot;&gt;</code>
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@eonasdan/[email protected].10/dist/css/tempus-dominus.min.css&quot; crossorigin=&quot;anonymous&quot;&gt;</code>
</pre>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/docs/partials/plugins/customDateFormat.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</div>
<script src='/6/js/plugins/customDateFormat.js'></script>
<script type='text/javascript'>
tempusDominus.extend(window.tempusDominus.plugins.customDateFormat);
tempusDominus.extend(tempusDominus.plugins.customDateFormat);
const datetimepicker1 = new tempusDominus.TempusDominus(document.getElementById('datetimepicker1'),
{
localization: {
Expand All @@ -89,7 +89,7 @@

<div class='row'>
<pre>
<code class='language-js'>tempusDominus.extend(window.tempusDominus.plugins.customDateFormat);
<code class='language-js'>tempusDominus.extend(tempusDominus.plugins.customDateFormat);
//or
import customDateFormat from 'tempusDominus/plugins/customDateFormat'
tempusDominus.extend(customDateFormat);
Expand Down
Loading

0 comments on commit 1a3ff82

Please sign in to comment.