Skip to content

Fix Renderer this.renderDate#376

Open
smg6511 wants to merge 1 commit intoBruno17:masterfrom
smg6511:renderers-pr
Open

Fix Renderer this.renderDate#376
smg6511 wants to merge 1 commit intoBruno17:masterfrom
smg6511:renderers-pr

Conversation

@smg6511
Copy link
Copy Markdown

@smg6511 smg6511 commented Jun 11, 2021

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.

Add a basic regex test for unix timestamp (casting string matched to number) instead of assuming incoming value's data type is number
@smg6511 smg6511 changed the title Update renderDate Fix Renderer this.renderDate Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant