text: /*!
   * UI development toolkit for HTML5 (OpenUI5)
   * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(['jquery.sap.global','./UniversalDate'],function(q,U){"use strict";var I=U.extend("sap.ui.core.date.Islamic",{constructor:function(){var a=arguments;if(a.length>1){a=f(a);}this.oDate=this.createDate(Date,a);this.sCalendarType=sap.ui.core.CalendarType.Islamic;}});I.UTC=function(){var a=f(arguments);return Date.UTC.apply(Date,a);};I.now=function(){return Date.now();};var B=1400,G=1721425.5,c=1948439.5,d=-42521587200000,O=86400000;var C=null;function t(o){var a=o.year,b=o.month,k=o.day,l,n,r,M,D,L,J;L=0;if((b+1)>2){L=j(a)?-1:-2;}J=(G-1)+(365*(a-1))+Math.floor((a-1)/4)+(-Math.floor((a-1)/100))+Math.floor((a-1)/400)+Math.floor((((367*(b+1))-362)/12)+L+k);J=Math.floor(J)+0.5;D=J-c;M=Math.floor(D/29.530588853);if(M<0){l=Math.floor(M/12)+1;n=M%12;if(n<0){n+=12;}r=D-m(l,n)+1;}else{M++;while(g(M)>D){M--;}l=Math.floor(M/12)+1;n=M%12;r=(D-g(12*(l-1)+n))+1;}return{day:r,month:n,year:l};}function e(o){var a=o.year,b=o.month,k=o.day,M=a<1?m(a,b):g(12*(a-1)+b),J=k+M+c-1,l=Math.floor(J-0.5)+0.5,D=l-G,Q=Math.floor(D/146097),n=h(D,146097),r=Math.floor(n/36524),s=h(n,36524),u=Math.floor(s/1461),v=h(s,1461),y=Math.floor(v/365),Y=(Q*400)+(r*100)+(u*4)+y,w,x,z,A,E,F,L,H;if(!(r==4||y==4)){Y++;}z=G+(365*(Y-1))+Math.floor((Y-1)/4)-(Math.floor((Y-1)/100))+Math.floor((Y-1)/400);A=l-z;E=(G-1)+(365*(Y-1))+Math.floor((Y-1)/4)-(Math.floor((Y-1)/100))+Math.floor((Y-1)/400)+Math.floor((739/12)+((j(Y)?-1:-2))+1);L=0;if(l<E){L=0;}else{L=j(Y)?1:2;}w=Math.floor((((A+L)*12)+373)/367);F=(G-1)+(365*(Y-1))+Math.floor((Y-1)/4)-(Math.floor((Y-1)/100))+Math.floor((Y-1)/400);H=0;if(w>2){H=j(Y)?-1:-2;}F+=Math.floor((((367*w)-362)/12)+H+1);x=(l-F)+1;return{day:x,month:w-1,year:Y};}function f(a){var b=Array.prototype.slice.call(a),o,k;o={year:a[0],month:a[1],day:a[2]!==undefined?a[2]:1};k=e(o);b[0]=k.year;b[1]=k.month;b[2]=k.day;return b;}function i(){var D,o;C={};D=sap.ui.getCore().getConfiguration().getFormatSettings().getLegacyDateFormat();o=sap.ui.getCore().getConfiguration().getFormatSettings().getLegacyDateCalendarCustomizing();o=o||[];if(!D&&!o.length){q.sap.log.info("No calendar customizations.");return;}if((D&&!o.length)||(!D&&o.length)){q.sap.log.warning("There is an inconsistency between customization data ["+JSON.stringify(o)+"] and the date format ["+D+"]. Calendar customization won't be used.");return;}o.forEach(function(E){if(E.dateFormat===D){var a=p(E.gregDate);var b=new Date(Date.UTC(a.year,a.month-1,a.day));var M=b.getTime();var k=(M-d)/O;a=p(E.islamicMonthStart);var l=(a.year-1)*12+a.month-1;C[l]=k;}});q.sap.log.info("Working with date format: ["+D+"] and customization: "+JSON.stringify(o));}function p(D){return{year:parseInt(D.substr(0,4),10),month:parseInt(D.substr(4,2),10),day:parseInt(D.substr(6,2),10)};}function g(a){if(!C){i();}var b=C[a];if(!b){var y=Math.floor(a/12)+1;var k=a%12;b=m(y,k);}return b;}function m(y,a){return Math.ceil(29.5*a)+(y-1)*354+Math.floor((3+11*y)/30.0);}function h(a,b){return a-(b*Math.floor(a/b));}function j(y){return!(y%400)||(!(y%4)&&!!(y%100));}I.prototype._getIslamic=function(){return t({day:this.oDate.getDate(),month:this.oDate.getMonth(),year:this.oDate.getFullYear()});};I.prototype._setIslamic=function(o){var a=e(o);return this.oDate.setFullYear(a.year,a.month,a.day);};I.prototype._getUTCIslamic=function(){return t({day:this.oDate.getUTCDate(),month:this.oDate.getUTCMonth(),year:this.oDate.getUTCFullYear()});};I.prototype._setUTCIslamic=function(o){var a=e(o);return this.oDate.setUTCFullYear(a.year,a.month,a.day);};I.prototype.getDate=function(D){return this._getIslamic().day;};I.prototype.getMonth=function(){return this._getIslamic().month;};I.prototype.getYear=function(){return this._getIslamic().year-B;};I.prototype.getFullYear=function(){return this._getIslamic().year;};I.prototype.setDate=function(D){var o=this._getIslamic();o.day=D;return this._setIslamic(o);};I.prototype.setMonth=function(M,D){var o=this._getIslamic();o.month=M;if(D!==undefined){o.day=D;}return this._setIslamic(o);};I.prototype.setYear=function(y){var o=this._getIslamic();o.year=y+B;return this._setIslamic(o);};I.prototype.setFullYear=function(y,M,D){var o=this._getIslamic();o.year=y;if(M!==undefined){o.month=M;}if(D!==undefined){o.day=D;}return this._setIslamic(o);};I.prototype.getUTCDate=function(D){return this._getUTCIslamic().day;};I.prototype.getUTCMonth=function(){return this._getUTCIslamic().month;};I.prototype.getUTCFullYear=function(){return this._getUTCIslamic().year;};I.prototype.setUTCDate=function(D){var o=this._getUTCIslamic();o.day=D;return this._setUTCIslamic(o);};I.prototype.setUTCMonth=function(M,D){var o=this._getUTCIslamic();o.month=M;if(D!==undefined){o.day=D;}return this._setUTCIslamic(o);};I.prototype.setUTCFullYear=function(y,M,D){var o=this._getUTCIslamic();o.year=y;if(M!==undefined){o.month=M;}if(D!==undefined){o.day=D;}return this._setUTCIslamic(o);};return I;});
  