albinasoft-ui-package 1.1.45 → 1.1.47
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.
@@ -21,18 +21,8 @@ var customTrLocale = {
|
|
21
21
|
localize: {
|
22
22
|
month: function (n) {
|
23
23
|
var months = [
|
24
|
-
"Ocak",
|
25
|
-
"
|
26
|
-
"Mart",
|
27
|
-
"Nisan",
|
28
|
-
"Mayıs",
|
29
|
-
"Haziran",
|
30
|
-
"Temmuz",
|
31
|
-
"Ağustos",
|
32
|
-
"Eylül",
|
33
|
-
"Ekim",
|
34
|
-
"Kasım",
|
35
|
-
"Aralık",
|
24
|
+
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran",
|
25
|
+
"Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
|
36
26
|
];
|
37
27
|
return months[n];
|
38
28
|
},
|
@@ -50,17 +40,43 @@ var customTrLocale = {
|
|
50
40
|
weekStartsOn: 1,
|
51
41
|
},
|
52
42
|
};
|
43
|
+
// TR saatine göre ISO-like string oluşturan yardımcı fonksiyon
|
44
|
+
var toTrIsoString = function (date) {
|
45
|
+
var pad = function (n) { return n.toString().padStart(2, "0"); };
|
46
|
+
var year = date.getFullYear();
|
47
|
+
var month = pad(date.getMonth() + 1);
|
48
|
+
var day = pad(date.getDate());
|
49
|
+
var hour = pad(date.getHours());
|
50
|
+
var minute = pad(date.getMinutes());
|
51
|
+
var second = pad(date.getSeconds());
|
52
|
+
var ms = date.getMilliseconds().toString().padStart(3, "0");
|
53
|
+
return "".concat(year, "-").concat(month, "-").concat(day, "T").concat(hour, ":").concat(minute, ":").concat(second, ".").concat(ms);
|
54
|
+
};
|
53
55
|
var CustomDateTimePicker = function (_a) {
|
54
56
|
var id = _a.id, name = _a.name, label = _a.label, value = _a.value, placeholder = _a.placeholder, _b = _a.required, required = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, _c = _a.conditionalErrorVisible, conditionalErrorVisible = _c === void 0 ? false : _c, conditionalErrorMessage = _a.conditionalErrorMessage, tooltip = _a.tooltip, description = _a.description, _d = _a.disabled, disabled = _d === void 0 ? false : _d, className = _a.className, style = _a.style, showTimeSelect = _a.showTimeSelect, showTimeSelectOnly = _a.showTimeSelectOnly, showYearDropdown = _a.showYearDropdown, _e = _a.timeFormat, timeFormat = _e === void 0 ? TimeFormat.HM : _e, timeIntervals = _a.timeIntervals, submitted = _a.submitted, onChange = _a.onChange;
|
55
|
-
// Eğer form gönderildiyse ve required field boşsa hata durumu geçerli olsun.
|
56
57
|
var isInvalid = submitted && required && !value;
|
58
|
+
// Kullanıcının seçtiği tarihi TR saatinde, Z içermeyen şekilde Date nesnesi olarak dışarı ver
|
59
|
+
var handleChange = function (date) {
|
60
|
+
if (!date) {
|
61
|
+
onChange(null);
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
// TR saatiyle toplanmış Date üret
|
65
|
+
var trIso = toTrIsoString(date);
|
66
|
+
var localDate = new Date(trIso); // UTC'ye çevrilmeden oluşturulmuş Date objesi
|
67
|
+
onChange(localDate);
|
68
|
+
};
|
57
69
|
return (react_1.default.createElement("div", { className: "col-12", style: style },
|
58
70
|
react_1.default.createElement("div", { className: "form-group" },
|
59
71
|
react_1.default.createElement("label", { htmlFor: id, className: "form-label" }, label),
|
60
72
|
react_1.default.createElement("div", { className: "position-relative" },
|
61
73
|
react_1.default.createElement(react_bootstrap_1.OverlayTrigger, { placement: "bottom", overlay: tooltip ? (react_1.default.createElement(react_bootstrap_1.Tooltip, { id: "tooltip-".concat(id) }, tooltip)) : (react_1.default.createElement(react_1.default.Fragment, null)) },
|
62
74
|
react_1.default.createElement("div", null,
|
63
|
-
react_1.default.createElement(react_datepicker_1.default, { id: id, name: name, selected: value, onChange:
|
75
|
+
react_1.default.createElement(react_datepicker_1.default, { id: id, name: name, selected: value, onChange: handleChange, className: "form-control ".concat(className || "", " ").concat(submitted
|
76
|
+
? isInvalid
|
77
|
+
? "is-invalid"
|
78
|
+
: "is-valid"
|
79
|
+
: ""), placeholderText: placeholder, disabled: disabled, required: required, showTimeSelect: showTimeSelect || false, showTimeSelectOnly: showTimeSelectOnly || false, showYearDropdown: showYearDropdown || false, showTimeCaption: false, timeFormat: timeFormat, locale: customTrLocale, dateFormat: showTimeSelectOnly
|
64
80
|
? timeFormat
|
65
81
|
: showTimeSelect
|
66
82
|
? "dd.MM.yyyy HH:mm"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "albinasoft-ui-package",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.47",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"scripts": {
|
@@ -13,6 +13,7 @@
|
|
13
13
|
"ag-grid-community": "^33.1.1",
|
14
14
|
"ag-grid-react": "^33.1.1",
|
15
15
|
"date-fns": "^4.1.0",
|
16
|
+
"date-fns-tz": "^3.2.0",
|
16
17
|
"quill": "^2.0.3",
|
17
18
|
"react": "^18.0.0",
|
18
19
|
"react-bootstrap": "^2.10.6",
|