@gez/date-time-kit 1.1.0 → 1.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/dist/index.html +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html
|
|
2
|
+
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"granularity": dataTimeKit.Granularity.second,
|
|
51
51
|
// "startTime": rand.startTime,
|
|
52
52
|
// "endTime": rand.endTime,
|
|
53
|
-
"period":
|
|
53
|
+
"period": false,
|
|
54
54
|
// "maxLength": 60 * 60 * 1000,
|
|
55
55
|
// "minLength": 60 * 60 * 1000,
|
|
56
56
|
"timeZone": 2,
|
|
57
|
-
"lang": 'arAE'
|
|
57
|
+
// "lang": 'arAE'
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
console.log('start', dataTimeKit.default.getTimeStringByTimeZone(result.time, 8, 2));
|
package/dist/index.js
CHANGED
|
@@ -130,7 +130,7 @@ var t={757:function(t){t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUi
|
|
|
130
130
|
<span>-</span>
|
|
131
131
|
${c(t.endDate.year,t.endDate.month,t.endDate.date)}`:t.granularity<=l.second?`${c(t.startDate.year,t.startDate.month,t.startDate.date)} ${g(t.startTime.hour,t.startTime.minute,t.startTime.second)}
|
|
132
132
|
<span>-</span>
|
|
133
|
-
${c(t.endDate.year,t.endDate.month,t.endDate.date)} ${g(t.endTime.hour,t.endTime.minute,t.endTime.second)}`:`${T(t.startDate,t.startTime)} <span>-</span> ${T(t.endDate,t.endTime)}`:t.granularity<=l.day?c(t.startDate.year,t.startDate.month,t.startDate.date):t.granularity<=l.second?`${c(t.startDate.year,t.startDate.month,t.startDate.date)} ${g(t.startTime.hour,t.startTime.minute,t.startTime.second)}`:T(t.startDate,t.startTime)}function P(t,e){let a=W(e);console.log(a);let i=t.querySelectorAll('.dt-time-select-item[data-hour][data-status="end"]'),n=t.querySelectorAll('.dt-time-select-item[data-minute][data-status="end"]'),d=t.querySelectorAll('.dt-time-select-item[data-second][data-status="end"]');for(let t=0,e=59;t<60;t++,e--){let s=i[t];
|
|
133
|
+
${c(t.endDate.year,t.endDate.month,t.endDate.date)} ${g(t.endTime.hour,t.endTime.minute,t.endTime.second)}`:`${T(t.startDate,t.startTime)} <span>-</span> ${T(t.endDate,t.endTime)}`:t.granularity<=l.day?c(t.startDate.year,t.startDate.month,t.startDate.date):t.granularity<=l.second?`${c(t.startDate.year,t.startDate.month,t.startDate.date)} ${g(t.startTime.hour,t.startTime.minute,t.startTime.second)}`:T(t.startDate,t.startTime)}function P(t,e){let a=W(e);console.log(a);let i=t.querySelectorAll('.dt-time-select-item[data-hour][data-status="end"]'),n=t.querySelectorAll('.dt-time-select-item[data-minute][data-status="end"]'),d=t.querySelectorAll('.dt-time-select-item[data-second][data-status="end"]');for(let t=0,e=59;t<60;t++,e--){let s=i[t];e<a.hour?s&&s.classList.add("dt-time-select-item-disabled"):s&&s.classList.remove("dt-time-select-item-disabled");let o=n[t];o&&e<a.minute?o&&o.classList.add("dt-time-select-item-disabled"):o&&o.classList.remove("dt-time-select-item-disabled");let l=d[t];e<a.second?l&&l.classList.add("dt-time-select-item-disabled"):l&&l.classList.remove("dt-time-select-item-disabled")}t.querySelector(".dt-time-string").innerHTML=q(e)}function W(t){if(!t.maxLength)return{hour:23,minute:59,second:59};let e=new Date(T(t.startDate,t.startTime)),a=new Date(T(t.endDate,t.endTime)).getTime()-e.getTime(),i={hour:0,minute:0,second:0},n=t.maxLength-a;for(let e=0;e<60;e++)e<24&&n-(e-t.endTime.hour)*36e5<0&&i.hour++,n-(e-t.endTime.minute)*6e4<0&&i.minute++,n-(e-t.endTime.second)*1e3<0&&i.second++;return i}async function G(t,e){let{root:a}=t;return new Promise((t,i)=>{var l;let c=[];if(a.querySelector(".dt-box"))return i("Date time picker has been created");let D=u(()=>{H(y,g),c.forEach(t=>{t.component.updateData(t.ele,g)})}),g=new Proxy(e,{set(t,e,a){let i=!1;if("object"==typeof t[e]){for(let n in t[e])if(t[e][n]!==a[n]){i=!0;break}}else t[e]!==a&&(i=!0);return!i||(t[e]=a,D(),!0)}}),y=document.createElement("div");y.classList.add("dt-box"),y.innerHTML=(l=e,`
|
|
134
134
|
<div class="dt-content">
|
|
135
135
|
<div class="dt-date-box">
|
|
136
136
|
<div class="dt-start dt-data-body"></div>
|