Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Timeline Date Formatter

    I am implementing a software in which I use smartclient's timeline widget.

    However, I have a strange problem that I need help with.
    As you can see in attached image timeline date range is like 6/26,6/27 etc

    I need European formatting like 26/6,27/6 etc

    How can I manage this?

    I already tried
    Date.setShortDisplayFormat("toEuropeanShortDate")
    with no success so far

    Thank you
    Attached Files

    #2
    See the doc for HeaderLevel.titleFormatter.

    Comment


      #3
      Can you be more specific please?

      This is my timeline


      isc.Timeline.create({
      ID: "TM_user_work",
      height: "100%",
      startDate: firstDay,
      endDate: lastDay,
      dataSource:user_project_task,
      nameField:"hours",
      descriptionField:"notes",
      headerLevels: [ { unit: "month" }, { unit: "day" }],
      canResizeTimelineEvents: true,
      canEditLane: true,
      canDragEvents:false,
      showEventDescriptions: false,
      width:"100%",
      eventEditorFields: [],
      eventDialogFields: [],
      eventClick: "editAppointment(event, viewName)",
      backgroundClick: function (startDate, endDate) {
      var project=DF_select_project.getField("project_id").getValue()
      new_work(startDate,user,project)
      return false;
      },
      dayBodyClick: function (date, events, calendar, rowNum, colNum) {
      new_work(start_date,end_date);
      return false;
      }

      });

      How can I set titleFormatter for timeline's Header Levels?

      I have seen the doc. Not much info on how you actually format Timeline headerlevels


      This is from reference:

      String titleFormatter (headerLevel, startDate, endDate, defaultValue, viewer)
      An optional function for providing formatted HTML for the title of a given span in this HeaderLevel. If unset, Timelines use the titles array, if one is set, or generate default titles based on the unit-type and date-range. Note that this method will not run for spans in this headerLevel that have a non-null entry in the titles array.

      Parameters:
      headerLevel - type: HeaderLevel
      a reference to this headerLevel
      startDate - type: Date
      the start of the date-range covered by this span in this level
      endDate - type: Date
      the end of the date-range covered by this span in this level - may be null
      defaultValue - type: String
      the default title as generated by the Timeline
      viewer - type: Calendar
      a reference to the Calendar or Timeline

      Returns:
      type: String - The formatted title for the values passed in

      Comment


        #4
        Install the method on the headerLevel who's titles you want to affect, not on the Calendar - it's as easy to use as it appears to be - just install it and return a title that suits your needs, according to the passed headerLevel and date range

        Comment

        Working...
        X