locked
HTML Date format and item align RRS feed

  • Question

  • Hi,

    I have a Table control to display my data, and on my datetime field I'm using moment.js to format my datetime field.

     contentItem.dataBind("value", function (value) {
            if (value) {
                $(element).text(moment(value).format("DD.MM.YYYY"));
            }
        });

    After that, my row is aligned left, even tho i set it to center. And i cannot change it back to center

    even with css.

    Any help appriciated.

    Tuesday, June 17, 2014 1:06 PM

Answers

  • Found a solution:

     contentItem.dataBind("value", function (value) {
            if (value) {
            $(element).text(moment(value).format("DD.MM.YYYY"));
            }
       });
        $(element).closest("td").css("text-align", "center");

    • Marked as answer by Pratura Wednesday, June 18, 2014 6:53 AM
    Wednesday, June 18, 2014 6:53 AM

All replies

  • Found a solution:

     contentItem.dataBind("value", function (value) {
            if (value) {
            $(element).text(moment(value).format("DD.MM.YYYY"));
            }
       });
        $(element).closest("td").css("text-align", "center");

    • Marked as answer by Pratura Wednesday, June 18, 2014 6:53 AM
    Wednesday, June 18, 2014 6:53 AM
  • Found a solution:

     contentItem.dataBind("value", function (value) {
            if (value) {
            $(element).text(moment(value).format("DD.MM.YYYY"));
            }
       });
        $(element).closest("td").css("text-align", "center");

    Glad that you have solved this issue by yourself, and thanks for sharing your solution to us. 

    Best regards

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 20, 2014 3:12 AM