You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2022/05/18 21:40:07 UTC
[GitHub] [royale-compiler] cristallium opened a new issue, #212: Issue on setting Date
cristallium opened a new issue, #212:
URL: https://github.com/apache/royale-compiler/issues/212
This code will result in an issue :
```
var d1:Date = new Date();
d1.hours = d1.minutes = d1.milliseconds = 0;
trace ("d1->" + d1.getTime());
```
will output :
`d1->NaN`
should output a number
JS generated is the following :
```
var /** @type {Date} */ d1 = new Date();
d1.setHours(d1.setMinutes(d1.setMilliseconds(0)));
org.apache.royale.utils.Language.trace("d1->" + d1.getTime());
```
Workaround :
```
var d1:Date = new Date();
d1.hours = 0;
d1.minutes = 0;
d1.milliseconds = 0;
trace ("d1->" + d1.getTime());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [royale-compiler] joshtynjala closed issue #212: Issue on setting Date
Posted by GitBox <gi...@apache.org>.
joshtynjala closed issue #212: Issue on setting Date
URL: https://github.com/apache/royale-compiler/issues/212
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@royale.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org