CA Service Management

  • 1.  Date field for birthday

    Posted Mar 12, 2018 01:45 PM

    Hello,

     

    I had a need to create a birthday date field but Service Desk only allow dates after 1970.

    I came with the idea to create that field as a string, and then in the detail_cnt create the field with javascript.

    But unfortunately I'm not able to save the value of that javascrip field to the SDM field.

     

    This was my attempt:

    detailRowHdr("Birthday Date");
    detailSetRowData("<input type=date name='z_bday' value='$args.z_birthday' size=8>");

    <PDM_SET args.z_birthday=document.getElementById("z_bday").value>

     

    Anyone had the same need as I?

    How to solve this?

     

    Thank you in advance. 



  • 2.  Re: Date field for birthday

    Broadcom Employee
    Posted Mar 12, 2018 01:54 PM

    Is the update with date after 1970 unable to save or no matter what date?



  • 3.  Re: Date field for birthday

    Posted Mar 12, 2018 02:19 PM

    Hi Derek,

     

    No mather what date is.



  • 4.  Re: Date field for birthday

    Broadcom Employee
    Posted Mar 12, 2018 03:04 PM

    Hello,

     

    I experimented with using a straight up date field and confirmed that the field is designed to only accept dates past 1970.

     

    I was wondering if you can describe what you are trying to do here.  Are you trying to create some kind of date field chooser or some kind of control to confirm for a valid input?

     

    One thing I could think of trying is to divide the birthdate into three fields, day, month, and year.  Have end users input the values into each field and when saved, concatenate the field as a string.



  • 5.  Re: Date field for birthday

    Broadcom Employee
    Posted Mar 12, 2018 05:48 PM

    Francisco, this is a very good topic that our date by default can't go back before 1970(the Unix start time) but you would

    need it for birth day. Try modify the v30_date_helper.htmpl in bopcfg\www\htmpl\default

    --copy this file to site\mods\...folder

    --edit the copy...look at

    for (var z = nowY - 10; z < nowY + 10; z++)

    and if you change nowY + 10 to nowY  - 70, you should have 70 more years and this should be good enough for birth days.

    --pdm_webcache -H and refresh the browser cache

    Thanks

    Chi

     



  • 6.  Re: Date field for birthday

    Broadcom Employee
    Posted Mar 12, 2018 05:58 PM

    Sorry I just tested this and this modification only changes the selection of years but when you save it it will get to current

    year(2018 if it is before 1970) so eventually it still does not work..,

    I would really like continuation of this discussions of this topic.



  • 7.  Re: Date field for birthday

    Posted Mar 13, 2018 05:27 AM

    Hi,

     

    I've found that the date fields also use the script "convert_date.js"

    I will try to understand how this works.

     

    But I think that the easy way is to create a string field and use a javascript date chooser.



  • 8.  Re: Date field for birthday

    Broadcom Employee
    Posted Mar 14, 2018 11:23 AM

    Francisco, I found a perfect solution for this birthday thing. The solution uses the embedded calendar combining the flexibility of htmpl files. I will publish a tech doc and give the link later. Now SDM can handle dates before 1970. Thanks _Chi



  • 9.  Re: Date field for birthday
    Best Answer

    Broadcom Employee
    Posted Mar 15, 2018 03:46 PM


  • 10.  Re: Date field for birthday

    Posted Mar 16, 2018 05:43 AM

    Thanks a lot for your help Chi.