forked from loafle/openapi-generator-original
		
	This commit is contained in:
		
							parent
							
								
									c1b53df345
								
							
						
					
					
						commit
						9f1d012d14
					
				@ -541,12 +541,15 @@
 | 
				
			|||||||
{{/usePromises}}  };
 | 
					{{/usePromises}}  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{{#emitJSDoc}}  /**
 | 
					{{#emitJSDoc}}  /**
 | 
				
			||||||
   * Parses an ISO-8601 string representation of a date value.
 | 
					   * Parses an ISO-8601 string representation or epoch representation of a date value.
 | 
				
			||||||
   * @param {String} str The date value as a string.
 | 
					   * @param {String} str The date value as a string.
 | 
				
			||||||
   * @returns {Date} The parsed date object.
 | 
					   * @returns {Date} The parsed date object.
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
{{/emitJSDoc}}  exports.parseDate = function(str) {
 | 
					{{/emitJSDoc}}  exports.parseDate = function(str) {
 | 
				
			||||||
 | 
					    if (isNaN(str)) {
 | 
				
			||||||
      return new Date(str.replace(/T/i, ' '));
 | 
					      return new Date(str.replace(/T/i, ' '));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return new Date(+str);
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{{#emitJSDoc}}  /**
 | 
					{{#emitJSDoc}}  /**
 | 
				
			||||||
 | 
				
			|||||||
@ -519,13 +519,16 @@ class ApiClient {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    {{#emitJSDoc}}/**
 | 
					    {{#emitJSDoc}}/**
 | 
				
			||||||
    * Parses an ISO-8601 string representation of a date value.
 | 
					    * Parses an ISO-8601 string representation or epoch representation of a date value.
 | 
				
			||||||
    * @param {String} str The date value as a string.
 | 
					    * @param {String} str The date value as a string.
 | 
				
			||||||
    * @returns {Date} The parsed date object.
 | 
					    * @returns {Date} The parsed date object.
 | 
				
			||||||
    */{{/emitJSDoc}}
 | 
					    */{{/emitJSDoc}}
 | 
				
			||||||
    static parseDate(str) {
 | 
					    static parseDate(str) {
 | 
				
			||||||
 | 
					        if (isNaN(str)) {
 | 
				
			||||||
            return new Date(str);
 | 
					            return new Date(str);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return new Date(+str);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    {{#emitJSDoc}}/**
 | 
					    {{#emitJSDoc}}/**
 | 
				
			||||||
    * Converts a value to the specified type.
 | 
					    * Converts a value to the specified type.
 | 
				
			||||||
 | 
				
			|||||||
@ -475,13 +475,16 @@ class ApiClient {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Parses an ISO-8601 string representation of a date value.
 | 
					    * Parses an ISO-8601 string representation or epoch representation of a date value.
 | 
				
			||||||
    * @param {String} str The date value as a string.
 | 
					    * @param {String} str The date value as a string.
 | 
				
			||||||
    * @returns {Date} The parsed date object.
 | 
					    * @returns {Date} The parsed date object.
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    static parseDate(str) {
 | 
					    static parseDate(str) {
 | 
				
			||||||
 | 
					        if (isNaN(str)) {
 | 
				
			||||||
            return new Date(str);
 | 
					            return new Date(str);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return new Date(+str);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Converts a value to the specified type.
 | 
					    * Converts a value to the specified type.
 | 
				
			||||||
 | 
				
			|||||||
@ -476,13 +476,16 @@ class ApiClient {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Parses an ISO-8601 string representation of a date value.
 | 
					    * Parses an ISO-8601 string representation or epoch representation of a date value.
 | 
				
			||||||
    * @param {String} str The date value as a string.
 | 
					    * @param {String} str The date value as a string.
 | 
				
			||||||
    * @returns {Date} The parsed date object.
 | 
					    * @returns {Date} The parsed date object.
 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    static parseDate(str) {
 | 
					    static parseDate(str) {
 | 
				
			||||||
 | 
					        if (isNaN(str)) {
 | 
				
			||||||
            return new Date(str);
 | 
					            return new Date(str);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return new Date(+str);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
    * Converts a value to the specified type.
 | 
					    * Converts a value to the specified type.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user