fable 3.0.61 → 3.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fable.compatible.js +8 -6
- package/dist/fable.compatible.min.js +1 -1
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +9 -7
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/package.json +1 -1
- package/source/services/Fable-Service-Utility.js +19 -10
- package/test/Utility_tests.js +4 -2
package/dist/fable.compatible.js
CHANGED
|
@@ -2913,7 +2913,9 @@ var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('
|
|
|
2913
2913
|
function FableServiceUtility(pFable,pOptions,pServiceHash){var _this33;_classCallCheck2(this,FableServiceUtility);_this33=_super19.call(this,pFable,pOptions,pServiceHash);_this33.templates={};// These two functions are used extensively throughout
|
|
2914
2914
|
_this33.waterfall=libAsyncWaterfall;_this33.eachLimit=libAsyncEachLimit;return _this33;}// Underscore and lodash have a behavior, _.extend, which merges objects.
|
|
2915
2915
|
// Now that es6 gives us this, use the native thingy.
|
|
2916
|
-
|
|
2916
|
+
// Nevermind, the native thing is not stable enough across environments
|
|
2917
|
+
// Basic shallow copy
|
|
2918
|
+
_createClass2(FableServiceUtility,[{key:"extend",value:function extend(pDestinationObject){for(var i=0;i<(arguments.length<=1?0:arguments.length-1);i++){var tmpSourceObject=i+1<1||arguments.length<=i+1?undefined:arguments[i+1];var tmpObjectProperties=Object.keys(tmpSourceObject);for(var k=0;k<tmpObjectProperties.length;k++){pDestinationObject[tmpObjectProperties[k]]=tmpSourceObject[tmpObjectProperties[k]];}}return pDestinationObject;}// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2917
2919
|
// string-based template with code snippets into simple executable pieces,
|
|
2918
2920
|
// with the added twist of returning a precompiled function ready to go.
|
|
2919
2921
|
},{key:"template",value:function template(pTemplateText,pData){var tmpTemplate=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration('Template');return tmpTemplate.buildTemplateFunction(pTemplateText,pData);}// Build a template function from a template hash, and, register it with the service provider
|
|
@@ -2935,17 +2937,17 @@ var tmpChunkSize=typeof pChunkSize=='number'?pChunkSize:0;var tmpChunkCache=type
|
|
|
2935
2937
|
// with ultra limited JS capabilities where those don't work.
|
|
2936
2938
|
},{key:"isoStringToDate",value:function isoStringToDate(pISOString){// Split the string into an array based on the digit groups.
|
|
2937
2939
|
var tmpDateParts=pISOString.split(/\D+/);// Set up a date object with the current time.
|
|
2938
|
-
var tmpReturnDate=new Date();//
|
|
2940
|
+
var tmpReturnDate=new Date();// Track the number of hours we need to adjust the date by based on the timezone.
|
|
2941
|
+
var tmpTimeZoneOffsetInHours=0;// Track the number of minutes we need to adjust the date by based on the timezone.
|
|
2942
|
+
var tmpTimeZoneOffsetInMinutes=0;// Manually parse the parts of the string and set each part for the
|
|
2939
2943
|
// date. Note: Using the UTC versions of these functions is necessary
|
|
2940
2944
|
// because we're manually adjusting for time zones stored in the
|
|
2941
2945
|
// string.
|
|
2942
2946
|
tmpReturnDate.setUTCFullYear(parseInt(tmpDateParts[0]));// The month numbers are one "off" from what normal humans would expect
|
|
2943
2947
|
// because January == 0.
|
|
2944
2948
|
tmpReturnDate.setUTCMonth(parseInt(tmpDateParts[1]-1));tmpReturnDate.setUTCDate(parseInt(tmpDateParts[2]));// Set the time parts of the date object.
|
|
2945
|
-
tmpReturnDate.setUTCHours(parseInt(tmpDateParts[3]));tmpReturnDate.setUTCMinutes(parseInt(tmpDateParts[4]));tmpReturnDate.setUTCSeconds(parseInt(tmpDateParts[5]));tmpReturnDate.setUTCMilliseconds(parseInt(tmpDateParts[6]));//
|
|
2946
|
-
|
|
2947
|
-
if(tmpDateParts[7]||tmpDateParts[8]){// Track the number of minutes we need to adjust the date by based on the timezone.
|
|
2948
|
-
var tmpTimeZoneOffsetInMinutes=0;// If there's a value for the minutes offset.
|
|
2949
|
+
tmpReturnDate.setUTCHours(parseInt(tmpDateParts[3]));tmpReturnDate.setUTCMinutes(parseInt(tmpDateParts[4]));tmpReturnDate.setUTCSeconds(parseInt(tmpDateParts[5]));tmpReturnDate.setUTCMilliseconds(parseInt(tmpDateParts[6]));// If there's a value for either the hours or minutes offset.
|
|
2950
|
+
if(tmpDateParts[7]||tmpDateParts[8]){// If there's a value for the minutes offset.
|
|
2949
2951
|
if(tmpDateParts[8]){// Convert the minutes value into an hours value.
|
|
2950
2952
|
tmpTimeZoneOffsetInMinutes=parseInt(tmpDateParts[8])/60;}// Add the hours and minutes values to get the total offset in hours.
|
|
2951
2953
|
tmpTimeZoneOffsetInHours=parseInt(tmpDateParts[7])+tmpTimeZoneOffsetInMinutes;// If the sign for the timezone is a plus to indicate the timezone is ahead of UTC time.
|