0

I am working on a tracker where i need the results in form of month and year for the entered dates. Eg. Input Entry date : 20-02-2017 (dd-mm-yyyy), (calculated) Output expected : Feb-17

I use SharePoint 2010

Sundeep P

2 Answers2

0

If you are using JavaScript, you will have to get input in mm-dd-yyyy format.

var Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var dt = new Date('02-20-2017');
var newDt = Months[dt.getMonth()] + '-' + dt.getFullYear().toString().substr(2,2);

It will give your prefeerred output Feb-17

  • SharePoint has a string format function which can do this conversion in one line: http://sharepoint.stackexchange.com/questions/160806/changing-date-format-using-javascript/160808#160808 – Danny '365CSI' Engelman Feb 20 '17 at 14:10
0

In a Calculated Column Formula use:

=TEXT( [Input Entrydate] , "mmm-yyy" )

source: http://www.viewmaster365.com/365coach/#/Calculated_Column_Functions_List

Danny '365CSI' Engelman
  • 21,176
  • 7
  • 35
  • 79