Some small notes
GetFields:function(text) {Try { varFields = []; varmatched = Text.match (/{{[a-za-z0-9_\ (\)]+}}/g); if(Array.isarray (matched)) { for(varIDX = 0; IDX < matched.length; idx++) {Fields.push ({' Origin ': Matched[idx],' Name ': Matched[idx].replace (/{{|}} /g, ") }); } } returnFields ; } Catch(e) {iAuto.Logger.error (e.stack); } },
Parse a piece of data and filter the valid data of an array with a regular.
GetCurrentTime:function() { Try { varDate =NewDate (); varDatestr = ' '; Datestr= Datestr + (date.getmonth () + 1); Datestr= Datestr + '/' +date.getdate (); Datestr= Datestr + '/' +date.getfullyear (); varHours =date.gethours (); varminutes =date.getminutes (); varseconds =date.getseconds (); if(Hours > 12) {Datestr= Datestr + "+ (hours-12); } Else{datestr= Datestr + "+hours; } minutes= minutes >= 10? Minutes: ' 0 ' +minutes; Seconds= Seconds >= 10? Seconds: ' 0 ' +seconds; Datestr= Datestr + ': ' +minutes; Datestr= Datestr + ': ' +seconds; if(Hours >= 12) {Datestr= Datestr + ' PM '; } Else{datestr= Datestr + ' AM '; } returnDatestr; } Catch(e) {iAuto.Logger.error (e.stack); } },
The algorithm for parsing time.
Business trip West Building