I have this silly problem, which I hope someone could help me enlighten. I am building an extension for Umbraco7's backoffice, for that I need to receive a simple string. My problem is the string return from the REST api contain double quotes and then AngularJS wont model bind. Here's my API method:
public String GetWeek()
{
var datetime = DateTime.Now;
var cultureInfo = new CultureInfo("da-DK");
var calendar = cultureInfo.Calendar;
var week = calendar.GetWeekOfYear(datetime, cultureInfo.DateTimeFormat.CalendarWeekRule, cultureInfo.DateTimeFormat.FirstDayOfWeek);
return datetime.Year + "-W" + week;
}
If someone could explain, how I get rid of these double quotes, I will be really grateful :)
The result:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">"2015-W24"</string>