Our pure JavaScript Scheduler component


Post by jorgeduarterekyl »

Hey,

Need your help. I want to get the value from the date that is inside the exceptionDate but just the string part with the dates and not the [string, number] object.
Is there someway you guys have to do this.
Need it cause I have a column in my database to save a string with these dates saved with a comma separating them.

Thank You.


Post by marcio »

Hey jorgeduarterekyl,

Thanks for reaching out.

To extract just the date strings from the exceptionDates array, you can map over the array and convert each date to a string format. Here's a simple example:

const exceptionDates = [
    ['2023-10-01', 1],
    ['2023-10-15', 2],
    ['2023-11-05', 3]
];

const dateStrings = exceptionDates.map(([dateString]) => dateString).join(',');

console.log(dateStrings); // Output: "2023-10-01,2023-10-15,2023-11-05"

This will give you a comma-separated string of dates. You can then save this string to your database column.

If you need further assistance or have more specific requirements, feel free to provide additional details.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by jorgeduarterekyl »

Thank you for the help.


Post Reply