Change language Datepicker JSON

Hello,

I'm using OS11, traditional Web App.

I'm trying to change the language to DatePicker using the AdvanceFormat option according to documentation. 

But it does not accept me the Json with or without double quotes..... what is worng? it must be something silly that I'm overlooking.

If I use quotes it does not like text format.

Thank you!

Solution

Hi Ulises,

First, if you want to use any variable text in OutSystems, you always need the double quotes around it (with very few exceptions). So your first image could never ever be the right way.

Secondly, the error message says exactly what is the problem: Service Studio tells you it expects something that has a DatePickerAdvancedFormat data type, while you supply it with a Text (obviously). If you check the AdvancedFormat Input Parameter, you'll see it is, indeed, of DatePickerAdvancedFormat type, which is a Structure containing two Attributes: EventsList, which is a list of Date Times specifying any calendar events, and AdvancedFormatJSON, which is the actual JSON you are trying to pass.

The easiest solution is to go to the DatePicker Widget on the Screen, click on the "+" icon in front of "AdvancedFormat", double click "AdvancedFormatJSON" (or select "Expression Editor" from the drop down), and there put your JSON (with double quotes!).

Solution

Thank you very much for your detailed explanation. In the end I did it like you said and in the AdvancedFormatJSON attribute I putted:


"{

i18n : {
        previousMonth : 'Vorige Maand',
        nextMonth     : 'Volgende Maand',
        months        : ['Januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','November','December'],
        weekdays      : ['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'],
        weekdaysShort : ['Zo','Ma','Di','Wo','Do','Vr','Zat']
    }

}"

Exactly like that.

Hi Ulises,

Great to hear I could help you solve it. Happy coding!