We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gpnf-sort-nested-form-entries.php
1 parent 7161a61 commit 130686cCopy full SHA for 130686c
gp-nested-forms/gpnf-sort-nested-form-entries.php
@@ -115,8 +115,14 @@ public function output_script() {
115
}
116
117
return entries.sort((a, b) => {
118
- let valA = a[sortFieldId]?.label || '';
119
- let valB = b[sortFieldId]?.label || '';
+ let valA, valB;
+ if (isDateField) {
120
+ valA = a[sortFieldId]?.value || '';
121
+ valB = b[sortFieldId]?.value || '';
122
+ } else {
123
+ valA = a[sortFieldId]?.label || '';
124
+ valB = b[sortFieldId]?.label || '';
125
+ }
126
127
if (isDateField) {
128
const dateA = new Date(valA);
0 commit comments