<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Date formatting issue with Visual API v2.1 in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544329#M16900</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17823"&gt;@v-viig&lt;/a&gt;&amp;nbsp;Thanks for reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is pbiviz.json file for visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "visual": {
    "name": "visual",
    "displayName": "Visual",
    "guid": "visual",
    "visualClassName": "Visual",
    "version": "1.0.0",
    "description": "",
    "supportUrl": "",
    "gitHubUrl": ""
  },
  "apiVersion": "2.1.0",
  "author": {
    "name": "",
    "email": ""
  },
  "assets": {
    "icon": "assets/icon.png"
  },
  "externalJS": [
    "node_modules/d3/d3.js",
    "node_modules/globalize/lib/globalize.js",
    "node_modules/powerbi-visuals-utils-tooltiputils/lib/index.js",
    "node_modules/globalize/lib/cultures/globalize.cultures.js",
    "node_modules/powerbi-visuals-utils-typeutils/lib/index.js",
    "node_modules/powerbi-visuals-utils-dataviewutils/lib/index.js",
    "node_modules/powerbi-visuals-utils-formattingutils/lib/index.js"
  ],
  "style": "style/visual.less",
  "capabilities": "capabilities.json",
  "dependencies": "dependencies.json",
  "stringResources": []
}&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Oct 2018 08:35:09 GMT</pubDate>
    <dc:creator>bhavesh-jadav</dc:creator>
    <dc:date>2018-10-17T08:35:09Z</dc:date>
    <item>
      <title>Date formatting issue with Visual API v2.1</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/543323#M16866</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have updated Visual API from 1.13.0 to v2.1.0 but I may have found some issue with the formatting of the date. I am using formatting utils to format the data in visual.&lt;/P&gt;&lt;P&gt;With v1.13.0 formatting is like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68747470733a2f2f692e696d6775722e636f6d2f6547687a62754a2e706e67.png" style="width: 415px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/126211i8FEE435892A412C8/image-size/large?v=v2&amp;amp;px=999" role="button" title="68747470733a2f2f692e696d6775722e636f6d2f6547687a62754a2e706e67.png" alt="68747470733a2f2f692e696d6775722e636f6d2f6547687a62754a2e706e67.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With v2.1.0 formatting is like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="68747470733a2f2f692e696d6775722e636f6d2f4d51745a5948422e706e67.png" style="width: 417px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/126212i5E9F3EB052481D5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="68747470733a2f2f692e696d6775722e636f6d2f4d51745a5948422e706e67.png" alt="68747470733a2f2f692e696d6775722e636f6d2f4d51745a5948422e706e67.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I just changed the API version by running the&amp;nbsp;pbiviz update 2.1.0&amp;nbsp;command and did not do any changes in the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I fix this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additional info:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using following code to format date valuse suing value formatter.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;dataLabelValueFormatted = this._format(
                        dataLabelValue,
                        {
                            "format": dataLabelFormat,
                            "cultureSelector": this.culture
                        });&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;dataLabelFormat value is G when using Date time field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;below is package.json file.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;"dependencies": {
    "d3": "^3.5.17",
    "powerbi-visuals-utils-dataviewutils": "^1.4.1",
    "powerbi-visuals-utils-formattingutils": "^3.0.2",
    "powerbi-visuals-utils-svgutils": "^1.1.0",
    "powerbi-visuals-utils-tooltiputils": "^1.0.1",
    "powerbi-visuals-utils-typeutils": "^1.1.0"
  },
  "devDependencies": {
    "@types/d3": "^3.5.41",
    "eslint": "^5.3.0",
    "tslint": "^5.11.0",
    "typescript": "^3.0.1"
  }&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Oct 2018 11:18:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/543323#M16866</guid>
      <dc:creator>bhavesh-jadav</dc:creator>
      <dc:date>2018-10-16T11:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date formatting issue with Visual API v2.1</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544314#M16898</link>
      <description>&lt;P&gt;Please share pbiviz.json file because it might be related to missing js files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Ignat Vilesov,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Software Engineer&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Microsoft Power BI Custom Visuals&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="mailto:pbicvsupport@microsoft.com" target="_blank"&gt;pbicvsupport@microsoft.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:23:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544314#M16898</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2018-10-17T08:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Date formatting issue with Visual API v2.1</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544329#M16900</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17823"&gt;@v-viig&lt;/a&gt;&amp;nbsp;Thanks for reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is pbiviz.json file for visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "visual": {
    "name": "visual",
    "displayName": "Visual",
    "guid": "visual",
    "visualClassName": "Visual",
    "version": "1.0.0",
    "description": "",
    "supportUrl": "",
    "gitHubUrl": ""
  },
  "apiVersion": "2.1.0",
  "author": {
    "name": "",
    "email": ""
  },
  "assets": {
    "icon": "assets/icon.png"
  },
  "externalJS": [
    "node_modules/d3/d3.js",
    "node_modules/globalize/lib/globalize.js",
    "node_modules/powerbi-visuals-utils-tooltiputils/lib/index.js",
    "node_modules/globalize/lib/cultures/globalize.cultures.js",
    "node_modules/powerbi-visuals-utils-typeutils/lib/index.js",
    "node_modules/powerbi-visuals-utils-dataviewutils/lib/index.js",
    "node_modules/powerbi-visuals-utils-formattingutils/lib/index.js"
  ],
  "style": "style/visual.less",
  "capabilities": "capabilities.json",
  "dependencies": "dependencies.json",
  "stringResources": []
}&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:35:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544329#M16900</guid>
      <dc:creator>bhavesh-jadav</dc:creator>
      <dc:date>2018-10-17T08:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Date formatting issue with Visual API v2.1</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544687#M16927</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17823"&gt;@v-viig&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason formatting was not working for date time is because I have to pass date time object while formatting date time and not date time string. Strange thing is that with API v1.13.0 I was passing date time string and it was working fine but with API v2.1 I had to pass date time object.&lt;/P&gt;&lt;P&gt;I found this solution by looking at the source code of LineDotChart&amp;nbsp;&lt;A href="https://github.com/Microsoft/powerbi-visuals-linedotchart/blob/master/src/visual.ts#L166" target="_blank"&gt;in visual.ts file @line 166&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 13:17:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Date-formatting-issue-with-Visual-API-v2-1/m-p/544687#M16927</guid>
      <dc:creator>bhavesh-jadav</dc:creator>
      <dc:date>2018-10-17T13:17:44Z</dc:date>
    </item>
  </channel>
</rss>

