UNPKG

@ecomplus/utils

Version:

JS utility functions to E-Com Plus (not only) related apps

28 lines 995 B
export default parsePhone; /** * @method * @memberof ecomUtils * @name parseDate * @description Returns customer birth date object from string. * @param {string} dateStr - Formatted date string * @param {string} [countryCode=$ecomConfig.get('country_code')] - Country ISO 3166-1 alpha-2 code * @returns {Object.<string, *>} * * @example * // Date string is fixed to digits only and parsed to E-Com Plus APIs date object * ecomUtils.parseDate('1990-01-12') * // => { day: 12, month: 1, year: 1990 } * ecomUtils.parseDate('10/02/1997', 'BR') * // => { day: 10, month: 2, year: 1997 } * * @example * // You can also set the configured country code first * $ecomConfig.set('country_code', 'BR') * // Then call `parseDate` without expliciting country code again * ecomUtils.parseDate('10/02/1997') * // => { day: 10, month: 2, year: 1997 } */ declare function parsePhone(dateStr: string, countryCode?: string): { [x: string]: any; }; //# sourceMappingURL=parse-date.d.ts.map