albinasoft-ui-package 1.1.47 → 1.1.48
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.
@@ -40,31 +40,17 @@ var customTrLocale = {
|
|
40
40
|
weekStartsOn: 1,
|
41
41
|
},
|
42
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
|
-
};
|
55
43
|
var CustomDateTimePicker = function (_a) {
|
56
44
|
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;
|
57
45
|
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
46
|
var handleChange = function (date) {
|
60
47
|
if (!date) {
|
61
48
|
onChange(null);
|
62
49
|
return;
|
63
50
|
}
|
64
|
-
// TR
|
65
|
-
var
|
66
|
-
|
67
|
-
onChange(localDate);
|
51
|
+
// TR saatini UTC’ye çevirmeden aynı şekilde yeni Date oluştur
|
52
|
+
var localDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
53
|
+
onChange(localDate); // TR saatli Date olarak döndür
|
68
54
|
};
|
69
55
|
return (react_1.default.createElement("div", { className: "col-12", style: style },
|
70
56
|
react_1.default.createElement("div", { className: "form-group" },
|