79799187

Date: 2025-10-24 21:52:49
Score: 0.5
Natty:
Report link

UPDATE: I got it working but I HOPE there is a cleaner/easier way?

Added this to the DataSource to ensure that date fields would be passed as ISO strings.

                parameterMap: function (data, type) {
                    if (type !== "read") {
                        if (data && data.models && Array.isArray(data.models)) {
                            // Convert all Date objects to ISO strings
                            for (var model of data.models) {
                                for (var [key, value] of Object.entries(model)) {
                                    if (value instanceof Date) {
                                        model[key] = value.toISOString();
                                    }
                                }
                            }
                        }
                    }
                    return data;
                }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: jrichview