Unplanned
Last Updated: 01 Jul 2021 14:05 by ADMIN
Brandon
Created on: 23 Jun 2014 15:18
Category: Globalization
Type: Feature Request
24
Add Quarter as a formatting option to toString
We'd like to be able to pass "Q" into the toString function for a date and have it return the quarter.

ex. 
kendo.toString(new Date(2000, 10, 6), "Q") -> Q4
1 comment
ADMIN
Viktor Tachev
Posted on: 01 Jul 2021 14:05

Hi Brandon,

 

The described functionality can be achieved by a bit of JavaScript code as illustrated below:

function getQuarter(date) {
	var month = date.getMonth() + 1;
	return "Q"+ (Math.ceil(month / 3));
}

The approach is also illustrated in this dojo:

https://dojo.telerik.com/ItUsoMiM

Regards,
Viktor Tachev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.