Date and time function not working correctly in prod
when I test in the lense studio app its ok but when i send to phone or to lens its not firing
current utc is 2018-03-03 04:00:00.000z
var datenow = new Date(Date.now()).toUTCString();
var countto = "2018-03-03 19:00:00.000Z";
var touchStartPos;
var event = script.createEvent("TouchStartEvent");
event.bind(function(eventData){
touchStartPos = eventData.getTouchPosition();
});
var event = script.createEvent("TouchEndEvent");
event.bind(function(eventData){
if (touchStartPos) {
var currentPos = eventData.getTouchPosition();
var posChange = new vec2(currentPos.x - touchStartPos.x, currentPos.y - touchStartPos.y);
if (posChange.y < 0 && datenow > countto) {
reveal();
} else if (posChange.y < 0 && datenow < countto)
{
denied();
}
}
});
Really stuck is meant to launch tomorrow if Anyone from snap can help please
Hi Patrick,
I'm not quite sure what you mean by "not firing", but in JavaScript, the following would be comparing string value, and not time value.
To compare time value, it would be better to use getTime(), which would return milliseconds since 1 January 1970 00:00:00 UTC, which would be numerical and so comparable using greater-than, less-than, and equal.
For example:
Let me know if I misunderstood and I can take a look again :)
Cheers!
Jon
Going to give it a whirl later
not firing in sense it fires in the preview but when i push to a device or submit it doesnt work.