Compare commits
3 Commits
b87ac53dc8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68a5cefd46 | ||
|
|
51aaa130b7 | ||
|
|
71ee0d9b72 |
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
.editableform {
|
.editableform {
|
||||||
|
|||||||
66
dist/bootstrap-editable/js/bootstrap-editable.js
vendored
66
dist/bootstrap-editable/js/bootstrap-editable.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
/**
|
/**
|
||||||
@@ -3882,19 +3882,25 @@ $(function(){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
var val = this.$input.val();
|
var val = this.$input.val();
|
||||||
|
|
||||||
// For Select2 v4.x, ensure we get the actual selected value
|
// --- Handle Bootstrap Datepicker ---
|
||||||
if (this.$input.data('select2')) {
|
var dp = this.$input.data('datepicker');
|
||||||
var selectedData = this.$input.select2('data');
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
if (selectedData && selectedData.length > 0) {
|
val = dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
// --- Handle Select2 v4.x ---
|
||||||
},
|
if (this.$input.data('select2')) {
|
||||||
|
var selectedData = this.$input.select2('data');
|
||||||
|
if (selectedData && selectedData.length > 0) {
|
||||||
|
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
str2value: function(str, separator) {
|
str2value: function(str, separator) {
|
||||||
if(typeof str !== 'string' || !this.isMultiple) {
|
if(typeof str !== 'string' || !this.isMultiple) {
|
||||||
@@ -4993,8 +4999,20 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2html: function(value, element) {
|
value2html: function(value, element) {
|
||||||
var text = value ? this.dpg.formatDate(value, this.parsedViewFormat, this.options.datepicker.language) : '';
|
let text = '';
|
||||||
Date.superclass.value2html.call(this, text, element);
|
|
||||||
|
if (value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
text = value;
|
||||||
|
} else if (value instanceof Date && typeof value.getUTCDate === 'function') {
|
||||||
|
text = this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// direct fallback: set text without using editableutils
|
||||||
|
if (element) {
|
||||||
|
element.textContent = text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
html2value: function(html) {
|
html2value: function(html) {
|
||||||
@@ -5002,7 +5020,17 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2str: function(value) {
|
value2str: function(value) {
|
||||||
return value ? this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language) : '';
|
if (!value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If value is already a string (like "2025-11-27"), just return it.
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, assume it's a Date object and format it.
|
||||||
|
return this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
},
|
},
|
||||||
|
|
||||||
str2value: function(str) {
|
str2value: function(str) {
|
||||||
@@ -5018,7 +5046,11 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
return this.$input.data('datepicker').date;
|
const dp = this.$input.data('datepicker');
|
||||||
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
|
return dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
|
}
|
||||||
|
return this.$input.val();
|
||||||
},
|
},
|
||||||
|
|
||||||
activate: function() {
|
activate: function() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
.editableform {
|
.editableform {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
/**
|
/**
|
||||||
@@ -3882,19 +3882,25 @@ $(function(){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
var val = this.$input.val();
|
var val = this.$input.val();
|
||||||
|
|
||||||
// For Select2 v4.x, ensure we get the actual selected value
|
// --- Handle Bootstrap Datepicker ---
|
||||||
if (this.$input.data('select2')) {
|
var dp = this.$input.data('datepicker');
|
||||||
var selectedData = this.$input.select2('data');
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
if (selectedData && selectedData.length > 0) {
|
val = dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
// --- Handle Select2 v4.x ---
|
||||||
},
|
if (this.$input.data('select2')) {
|
||||||
|
var selectedData = this.$input.select2('data');
|
||||||
|
if (selectedData && selectedData.length > 0) {
|
||||||
|
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
str2value: function(str, separator) {
|
str2value: function(str, separator) {
|
||||||
if(typeof str !== 'string' || !this.isMultiple) {
|
if(typeof str !== 'string' || !this.isMultiple) {
|
||||||
@@ -5061,8 +5067,20 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2html: function(value, element) {
|
value2html: function(value, element) {
|
||||||
var text = value ? this.dpg.formatDate(value, this.parsedViewFormat, this.options.datepicker.language) : '';
|
let text = '';
|
||||||
Date.superclass.value2html.call(this, text, element);
|
|
||||||
|
if (value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
text = value;
|
||||||
|
} else if (value instanceof Date && typeof value.getUTCDate === 'function') {
|
||||||
|
text = this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// direct fallback: set text without using editableutils
|
||||||
|
if (element) {
|
||||||
|
element.textContent = text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
html2value: function(html) {
|
html2value: function(html) {
|
||||||
@@ -5070,7 +5088,17 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2str: function(value) {
|
value2str: function(value) {
|
||||||
return value ? this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language) : '';
|
if (!value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If value is already a string (like "2025-11-27"), just return it.
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, assume it's a Date object and format it.
|
||||||
|
return this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
},
|
},
|
||||||
|
|
||||||
str2value: function(str) {
|
str2value: function(str) {
|
||||||
@@ -5086,7 +5114,11 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
return this.$input.data('datepicker').date;
|
const dp = this.$input.data('datepicker');
|
||||||
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
|
return dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
|
}
|
||||||
|
return this.$input.val();
|
||||||
},
|
},
|
||||||
|
|
||||||
activate: function() {
|
activate: function() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
.editableform {
|
.editableform {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
/**
|
/**
|
||||||
@@ -3882,19 +3882,25 @@ $(function(){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
var val = this.$input.val();
|
var val = this.$input.val();
|
||||||
|
|
||||||
// For Select2 v4.x, ensure we get the actual selected value
|
// --- Handle Bootstrap Datepicker ---
|
||||||
if (this.$input.data('select2')) {
|
var dp = this.$input.data('datepicker');
|
||||||
var selectedData = this.$input.select2('data');
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
if (selectedData && selectedData.length > 0) {
|
val = dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
// --- Handle Select2 v4.x ---
|
||||||
},
|
if (this.$input.data('select2')) {
|
||||||
|
var selectedData = this.$input.select2('data');
|
||||||
|
if (selectedData && selectedData.length > 0) {
|
||||||
|
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
str2value: function(str, separator) {
|
str2value: function(str, separator) {
|
||||||
if(typeof str !== 'string' || !this.isMultiple) {
|
if(typeof str !== 'string' || !this.isMultiple) {
|
||||||
@@ -4927,8 +4933,20 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2html: function(value, element) {
|
value2html: function(value, element) {
|
||||||
var text = value ? this.dpg.formatDate(value, this.parsedViewFormat, this.options.datepicker.language) : '';
|
let text = '';
|
||||||
Date.superclass.value2html.call(this, text, element);
|
|
||||||
|
if (value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
text = value;
|
||||||
|
} else if (value instanceof Date && typeof value.getUTCDate === 'function') {
|
||||||
|
text = this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// direct fallback: set text without using editableutils
|
||||||
|
if (element) {
|
||||||
|
element.textContent = text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
html2value: function(html) {
|
html2value: function(html) {
|
||||||
@@ -4936,7 +4954,17 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2str: function(value) {
|
value2str: function(value) {
|
||||||
return value ? this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language) : '';
|
if (!value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If value is already a string (like "2025-11-27"), just return it.
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, assume it's a Date object and format it.
|
||||||
|
return this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
},
|
},
|
||||||
|
|
||||||
str2value: function(str) {
|
str2value: function(str) {
|
||||||
@@ -4952,7 +4980,11 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
return this.$input.data('datepicker').date;
|
const dp = this.$input.data('datepicker');
|
||||||
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
|
return dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
|
}
|
||||||
|
return this.$input.val();
|
||||||
},
|
},
|
||||||
|
|
||||||
activate: function() {
|
activate: function() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
4
dist/jquery-editable/css/jquery-editable.css
vendored
4
dist/jquery-editable/css/jquery-editable.css
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
.editableform {
|
.editableform {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
/**
|
/**
|
||||||
@@ -3882,19 +3882,25 @@ $(function(){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
var val = this.$input.val();
|
var val = this.$input.val();
|
||||||
|
|
||||||
// For Select2 v4.x, ensure we get the actual selected value
|
// --- Handle Bootstrap Datepicker ---
|
||||||
if (this.$input.data('select2')) {
|
var dp = this.$input.data('datepicker');
|
||||||
var selectedData = this.$input.select2('data');
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
if (selectedData && selectedData.length > 0) {
|
val = dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
// --- Handle Select2 v4.x ---
|
||||||
},
|
if (this.$input.data('select2')) {
|
||||||
|
var selectedData = this.$input.select2('data');
|
||||||
|
if (selectedData && selectedData.length > 0) {
|
||||||
|
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
str2value: function(str, separator) {
|
str2value: function(str, separator) {
|
||||||
if(typeof str !== 'string' || !this.isMultiple) {
|
if(typeof str !== 'string' || !this.isMultiple) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
.editableform {
|
.editableform {
|
||||||
|
|||||||
32
dist/jqueryui-editable/js/jqueryui-editable.js
vendored
32
dist/jqueryui-editable/js/jqueryui-editable.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
/*! X-editable-bootstrap5 - v1.5.4
|
/*! X-editable-bootstrap5 - v1.5.7
|
||||||
* A maintained fork of x-editable for Bootstrap 5 support.
|
* A fork of x-editable for Bootstrap 5 support.
|
||||||
* https://git.24unix.net/tracer/x-editable
|
* https://git.24unix.net/tracer/x-editable
|
||||||
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
* Copyright (c) 2025 Micha Espey; Licensed MIT */
|
||||||
/**
|
/**
|
||||||
@@ -3882,19 +3882,25 @@ $(function(){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
var val = this.$input.val();
|
var val = this.$input.val();
|
||||||
|
|
||||||
// For Select2 v4.x, ensure we get the actual selected value
|
// --- Handle Bootstrap Datepicker ---
|
||||||
if (this.$input.data('select2')) {
|
var dp = this.$input.data('datepicker');
|
||||||
var selectedData = this.$input.select2('data');
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
if (selectedData && selectedData.length > 0) {
|
val = dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
// --- Handle Select2 v4.x ---
|
||||||
},
|
if (this.$input.data('select2')) {
|
||||||
|
var selectedData = this.$input.select2('data');
|
||||||
|
if (selectedData && selectedData.length > 0) {
|
||||||
|
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
str2value: function(str, separator) {
|
str2value: function(str, separator) {
|
||||||
if(typeof str !== 'string' || !this.isMultiple) {
|
if(typeof str !== 'string' || !this.isMultiple) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "x-editable-bootstrap5",
|
"name": "x-editable-bootstrap5",
|
||||||
"title": "X-editable-bootstrap5",
|
"title": "X-editable-bootstrap5",
|
||||||
"description": "A maintained fork of x-editable for Bootstrap 5 support.",
|
"description": "A fork of x-editable for Bootstrap 5 support.",
|
||||||
"version": "1.5.4",
|
"version": "1.5.7",
|
||||||
"homepage": "https://git.24unix.net/tracer/x-editable",
|
"homepage": "https://git.24unix.net/tracer/x-editable",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Micha Espey",
|
"name": "Micha Espey",
|
||||||
|
|||||||
@@ -90,8 +90,20 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2html: function(value, element) {
|
value2html: function(value, element) {
|
||||||
var text = value ? this.dpg.formatDate(value, this.parsedViewFormat, this.options.datepicker.language) : '';
|
let text = '';
|
||||||
Date.superclass.value2html.call(this, text, element);
|
|
||||||
|
if (value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
text = value;
|
||||||
|
} else if (value instanceof Date && typeof value.getUTCDate === 'function') {
|
||||||
|
text = this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// direct fallback: set text without using editableutils
|
||||||
|
if (element) {
|
||||||
|
element.textContent = text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
html2value: function(html) {
|
html2value: function(html) {
|
||||||
@@ -99,7 +111,17 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
value2str: function(value) {
|
value2str: function(value) {
|
||||||
return value ? this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language) : '';
|
if (!value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If value is already a string (like "2025-11-27"), just return it.
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, assume it's a Date object and format it.
|
||||||
|
return this.dpg.formatDate(value, this.parsedFormat, this.options.datepicker.language);
|
||||||
},
|
},
|
||||||
|
|
||||||
str2value: function(str) {
|
str2value: function(str) {
|
||||||
@@ -115,7 +137,11 @@ $(function(){
|
|||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
return this.$input.data('datepicker').date;
|
const dp = this.$input.data('datepicker');
|
||||||
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
|
return dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
|
}
|
||||||
|
return this.$input.val();
|
||||||
},
|
},
|
||||||
|
|
||||||
activate: function() {
|
activate: function() {
|
||||||
|
|||||||
28
src/inputs/select2/select2.js
vendored
28
src/inputs/select2/select2.js
vendored
@@ -281,19 +281,25 @@ $(function(){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
input2value: function() {
|
input2value: function() {
|
||||||
var val = this.$input.val();
|
var val = this.$input.val();
|
||||||
|
|
||||||
// For Select2 v4.x, ensure we get the actual selected value
|
// --- Handle Bootstrap Datepicker ---
|
||||||
if (this.$input.data('select2')) {
|
var dp = this.$input.data('datepicker');
|
||||||
var selectedData = this.$input.select2('data');
|
if (dp && typeof dp.getFormattedDate === 'function') {
|
||||||
if (selectedData && selectedData.length > 0) {
|
val = dp.getFormattedDate(this.options.format || 'yyyy-mm-dd');
|
||||||
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return val;
|
// --- Handle Select2 v4.x ---
|
||||||
},
|
if (this.$input.data('select2')) {
|
||||||
|
var selectedData = this.$input.select2('data');
|
||||||
|
if (selectedData && selectedData.length > 0) {
|
||||||
|
val = this.isMultiple ? selectedData.map(function(item) { return item.id; }) : selectedData[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
str2value: function(str, separator) {
|
str2value: function(str, separator) {
|
||||||
if(typeof str !== 'string' || !this.isMultiple) {
|
if(typeof str !== 'string' || !this.isMultiple) {
|
||||||
|
|||||||
Reference in New Issue
Block a user