Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date object #9

Open
pixelshaded opened this issue Jan 8, 2014 · 1 comment
Open

Date object #9

pixelshaded opened this issue Jan 8, 2014 · 1 comment

Comments

@pixelshaded
Copy link

Error: Could not coerce `UpdateDate` (value: 0001-01-01T00:00:00 <[class String]]>) from source object to [class Date] on target object
    at org.osflash.vanilla::Vanilla/extractValue()[/Users/jonny/Projects/as3/as3-vanilla/src/org/osflash/vanilla/Vanilla.as:110]
    at org.osflash.vanilla::Vanilla/injectFields()[/Users/jonny/Projects/as3/as3-vanilla/src/org/osflash/vanilla/Vanilla.as:65]
    at org.osflash.vanilla::Vanilla/extract()[/Users/jonny/Projects/as3/as3-vanilla/src/org/osflash/vanilla/Vanilla.as:46]

Getting a date object from c#, serialized to json, deserialized to javascript, passed to AS3 through external interface as an Object. Can this library convert date time strings to Date objects?

@mayakwd
Copy link
Contributor

mayakwd commented Jan 11, 2014

It would be better if you set [Transient]-tag for your field with the date and manually parse this string (because it is not a standard form for as3), something like:

[Transient]
public var date: Date;

[Marshall (field = "date")]
public function setDate (date: String): void {
   this.date = parseDate (date);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants