locked
JavaScript CRM 2011 RRS feed

  • Question

  • I want to set  Dates in CRM Form as below figure

    this is basically loan calculation of Installment for the periods of 2,3,4,5 years

    all dates to be set at once of entity record save.

    this figure use Excel formula EDate(start_date,months)

    is there any function of java script that set all Dates as below??


    Muhammad Sohail


    • Edited by sohail450 Monday, September 1, 2014 7:11 AM
    Monday, September 1, 2014 7:09 AM

Answers

  • Hello Muhammad,

    In JavaScript you can add months to a certain date, using the datejs library, as following:

    var yourDate = new Date(2014, 9, 1); // today var xMonthsInFuture= new Date(jan312009).add(x).month();

    For details, you can check out this article.

    Please let me know if this worked for you.

    Thank you,

    Cornel


    Cornel Croitoriu - Senior Software Developer

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    • Marked as answer by sohail450 Monday, October 13, 2014 1:00 PM
    Monday, September 1, 2014 3:52 PM

All replies

  • Hello Muhammad,

    In JavaScript you can add months to a certain date, using the datejs library, as following:

    var yourDate = new Date(2014, 9, 1); // today var xMonthsInFuture= new Date(jan312009).add(x).month();

    For details, you can check out this article.

    Please let me know if this worked for you.

    Thank you,

    Cornel


    Cornel Croitoriu - Senior Software Developer

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    • Marked as answer by sohail450 Monday, October 13, 2014 1:00 PM
    Monday, September 1, 2014 3:52 PM
  • Is this for one entity only?

    don't know if I understand it right but you can also change the date formatting under settings > system settings >formats > click on the "customize" button > date tab


    I Hope I could help. If I have answered please mark as 'Answer'. If was just helpful, please vote. Thanks and happy coding! Bruno Lucas, http://dynamicday.wordpress.com/

    Tuesday, September 2, 2014 12:32 PM