# Date operations (No API)

**URL:** <https://community.thunkable.com/t/date-operations-no-api/1355407>\
**Category:** Questions about Thunkable X\
**Tags:** date\_picker\
**Created:** [June 21, 2021, 2:50am UTC](https://community.thunkable.com/t/date-operations-no-api/1355407 "2021-06-21T02:50:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 21, 2021, 11:45am UTC](https://community.thunkable.com/t/date-operations-no-api/1355407/3 "2021-06-21T11:45:07Z")

</div>

I made a simple JavaScript code to get the date after certain number of days.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/a/3abdde88c6167caa0fdf318dd601e57c91150431.png)  
This is giving today’s date but if I add some days I get the future date in the label.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/494bca8f736409726dae0e87bcd1f94c75cc7716.png)

All managed by a web viewer extension running .html file added to the project as an asset…

**The Google sheet solution is still a viable solution and it works just as good.**

This is the blocks of the project

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/7044af6dde75f37b04b58893e40681c5762ecdec.png)

This is the JavaScript Code

```auto
<!DOCTYPE html>
<html>
<head>
<script src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js" type="text/javascript"></script>
</head>

<script>
  ThunkableWebviewerExtension.receiveMessage(function(message) {
    const dateObj = JSON.parse(message);
    const myDate = new Date(dateObj[0], dateObj[1] - 1, dateObj[2]);
    myDate.setDate(myDate.getDate() + dateObj[3]);
    ThunkableWebviewerExtension.postMessage(myDate.toUTCString());
});
</script>
</html>

```

---

_[View the full topic](https://community.thunkable.com/t/date-operations-no-api/1355407)._
