This is a migrated thread and some comments may be shown as answers.

mssql datetime field in json

1 Answer 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paweł
Top achievements
Rank 2
Paweł asked on 13 Jul 2012, 11:02 AM
Hi, I have another question and probably stems from my not accurately reading the documentation. Json gives me a date in the form:
{"ab_Id":"3",
"pr_Nazwa":"Subiekt GT",
"ab_Klucz":"fjo3r-3reft-et3fo-3rtt3-fwef2",
"adr_NazwaPelna":"ABC s.c. Sklep spo\u017cywczy",
"ab_DataDo":{
             "date":"2012-04-04 00:00:00",
             "timezone_type":3,
             "timezone":"UTC"
},
"adr_NIP":"894-56-53-563"},

How do I appeal to the variable $ { ab_DataDo } in the template assumed value of the field "date". Currently, my schema looks like this:

schema: {
                    model: {
                        fields: {
                            ab_Id: { type: "number" },
                            pr_Nazwa: { type: "string" },
                            ab_Klucz: { type: "string" },
                            adr_NazwaPelna: { type: "string" },
                            ab_DataDo: { type: "date"  },
                            adr_NIP: { type: "string" }
                        }
                    }
                },

The question
is probably pretty damn trivial.

Regards/Pozdrawiam
Paweł Kasztelan

1 Answer, 1 is accepted

Sort by
0
Paweł
Top achievements
Rank 2
answered on 13 Jul 2012, 11:34 AM
I found the answer, do not know if correct, but it works.

schema: {
                    model: {
                        fields: {
                            ab_Id: { type: "number" },
                            pr_Nazwa: { type: "string" },
                            ab_Klucz: { type: "string" },
                            adr_NazwaPelna: { type: "string" },
                            ab_DataDo: {
                                fields: {
                                    date: {type: "date"},
                                    timezone_type: { type: "string"},
                                    timezone: { type: "string" }
                                } },
                            adr_NIP: { type: "string" }
                        }
                    }
                },

And I used the template variable $ {ab_DataDo.date}
Now just to learn how to work the fields templates.
Tags
Grid
Asked by
Paweł
Top achievements
Rank 2
Answers by
Paweł
Top achievements
Rank 2
Share this question
or