Create a Date field from Text fields

markdown16.2
Let’s say you have a date separated into three Text fields and you want to merge all of them into one Date field.

That is possible, you can create Date fields with your information. Just copy paste the following code to a Calculation field:

var d = new Date();
d.setDate(@DD (Text));
d.setMonth(@MM (Text) – 1);
d.setFullYear(@YYYY (Text));
d

/* ——————————————————————————————————-

Created by BendixKiel ApS – Copenhagen based Podio Preferred Partner -with more than 6 years of experience in helping organizations implement Podio. Please feel free to contact us if you need help evaluate, structure or implement Podio in your organization.

BendixKiel ApS www.bendixkiel.org +45 71 99 05 80 anders@bendixkiel.org

———————————————————————————————————– */

 

Make sure you replace the @DD (Text) with your app’s day-of-month field, @MM (Text) with your app’s month field and @YYYY (Text) with your own app’s year field.

Thus, the following changes in “Modify Template”:


markdown16.1

 

gives us the following result:

 

markdown16.2

 

In case there is a Text field including all DD, MM, YYYY, you can still create a Date field using this text field. Just copy paste the following code to a Calculation field:

var d = new Date();

d.setDate(@Text Date in DD/MM/YYYY.substring(0,2));
d.setMonth(@Text Date in DD/MM/YYYY.substring(3,5) – 1);
d.setFullYear(@Text Date in DD/MM/YYYY.substring(6,10)); 
d

/* ——————————————————————————————————-

Created by BendixKiel ApS – Copenhagen based Podio Preferred Partner -with more than 6 years of experience in helping organizations implement Podio. Please feel free to contact us if you need help evaluate, structure or implement Podio in your organization.

BendixKiel ApS www.bendixkiel.org +45 71 99 05 80 anders@bendixkiel.org

———————————————————————————————————– */

 

Make sure you replace the @Text Date in DD/MM/YYYY with your app’s text date fieldIt has to be in format DD/MM/YYYY, not in MM/DD/YYYY or other kind of date format.

Let’s write all this in “Modify Template”. (Don’t forget to unclick the time display option of your Calculation field):

markdown16.3

The result is the following:

markdown16.4

 

, , ,

No comments yet.

Leave a Reply