on 04-28-2016 8:26 AM
hi experts,
I currently have some scripting that copies a date from a field in a table that is highlighted by the user and pastes them into custom text fields. This is the script:
What I then need to do, should the user then press the 'Change Record' button:
is to check to see if the selected startdate that has been pasted into the custom startdate field, is earlier than a specified date (which will be 01.04.203), but I am struggling to find out how to do this in Personas 2.
Can anyone help me with this?
thanks,
Ian
I would create Javascript date objects by parsing the string into day/month/year components and passing the values to the Date object's constructor, and then you can just compare the dates. Something like this:
// First pick apart the strings into year/month/day and then feed them into
// something like this...
var date1 = new Date(2016, 3, 28); // Today - months are 0-11 var date2 = new Date(2016, 3, 21); // Last week if(date2 < date1) { // do stuff }
Does that make sense?
Steve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks as always Steve.
We did parse the string as suggested, then used this as a numerical value to work out if the date was earlier or greater than a specific date as follows:
It may be complicated but it does the job.
We are moving to Version 3 shortly so this will become somewhat easier I hope .
thanks again Steve,
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.