App Connect Data Formatter Support Product Page

In progress

Add 30 Weeks to Date

Reported 15 Jun 2017 22:11:48
1
has this problem
15 Jun 2017 22:11:48 Brad Lawryk posted:
When I add 30 weeks or even 210 days to a date it does not render properly.

For example:

I have a drop menu with a series of dates.
In the database I need to insert that date as well as a date that is 30 weeks in the future.
It all works great except that the date is not rendering the month.

Example:

Date Selected is September 11, 2017 it correctly calculates the weeks but enters the date as 2018-00-09.

It doesn't matter if I am just displaying the date on a page or adding it to a database. It always calculates the month to 00.

I have tried this on server side as well as client side and the result is the same.

Replies

Replied 17 Jun 2017 05:06:22
17 Jun 2017 05:06:22 Teodor Kuduschiev replied:
Hello Brad,
What is the date format in your database, and what date format are you using on the front-end?
Replied 17 Jun 2017 05:33:12
17 Jun 2017 05:33:12 Brad Lawryk replied:
yyyy-mm-dd all around
Replied 17 Jun 2017 05:43:27
17 Jun 2017 05:43:27 Teodor Kuduschiev replied:
Thanks Brad,
Can you tell me what format are you adding and what is the code generated?
This reply was removed on 6/17/2017 7:43:01 AM.
See the changelog
This reply was removed on 6/17/2017 1:38:35 PM.
See the changelog
Replied 17 Jun 2017 07:42:48
17 Jun 2017 07:42:48 Brad Lawryk replied:
30 Weeks Added

2017-11-18 (Original Date)
2018-00-15 (yyyy-mm-dd)
June 15, 2018 (MMMM dd, yyyy)
2018-06-15 (yyyy-MM-dd)
2018-06-15T23:00:00.000Z (No Formatting)

Okay, I think I found the issue. When you add the 30 weeks it also includes hours, minutes and seconds which makes the mm mean minutes instead of month. And since the original does not have the time it for some reason sets the time as 23:00:00.000. Is this the way it is suppose to work for just a simple date not a timestamp? I can live with it as now I know how to work around it though.
Replied 18 Jun 2017 07:10:30
18 Jun 2017 07:10:30 Teodor Kuduschiev replied:
Could you please send me a screenshot of how is this set up in your server action to ?
Replied 18 Jun 2017 14:13:48
18 Jun 2017 14:13:48 Brad Lawryk replied:
Coming right up .....

Reply to this topic