Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

Fix Renderer this.renderDate #376

Open smg6511 opened 3 years ago

smg6511 commented 3 years ago

CONTEXT: Column rendering of dates in migxdb

PROBLEM: When a unix timestamp is passed into the renderDate function, it's data type may be string instead of number (even though the database's column type is int). In this case, renderDate currently fails to recognize the data as a numeric timestamp and returns an empty string.

SOLUTION: Adds a basic regex test for unix timestamp and explicitly casts a match to number (via parseInt) to ensure numeric string timestamps are rendered properly.