Need Js code for calculate date difference between date pickers excluding holidays - InfoPath Dev
in

InfoPath Dev

Need Js code for calculate date difference between date pickers excluding holidays

Last post 09-21-2010 05:14 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-20-2010 05:40 AM

    Need Js code for calculate date difference between date pickers excluding holidays

    Actly i need to calculate date difference excluding holidays.i have maintained a database for holiday list.0-is holidays and 1- is working day.

    maintaing every for everymonth for a year.while selecting date picker holidays shold not count..can i get js code for these validations

    Filed under:
  • 09-21-2010 05:14 PM In reply to

    Re: Need Js code for calculate date difference between date pickers excluding holidays

    Does your form already query the database? Can you export the database file to an XML resource form and include in your form's template? If so, you should be able to do this without code. You can use rules and a count function to iteratively walk through from one date to another and add the value for each one. Check out Jo-Anne's recent download on how to iteratively copy values from a SharePoint list to a form. Same technique but instead of copying, you are just adding values and decrementing the count.

    Good luck!

    Note: eval(eval(...)) technique probably wouldn't work here since your database XML file will have all 365 days in it and it needs to go from one to another. Also note: you'll need to have a day for Feb 29 during leap years which means you probably need to just create an XML resource with 4 year's worth of work/holidays in it and start on the right year (add 1 if (current year minus 2008 mod 4) is equal to zero)

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.