Skip to content

fix: Proper processing of date fields (Domain Expiry) with cleanup of unnecessary Date comparison functions#6638

Merged
CommanderStorm merged 11 commits intolouislam:masterfrom
shanto:domain-expiry
Jan 9, 2026
Merged

fix: Proper processing of date fields (Domain Expiry) with cleanup of unnecessary Date comparison functions#6638
CommanderStorm merged 11 commits intolouislam:masterfrom
shanto:domain-expiry

Conversation

@shanto
Copy link
Copy Markdown
Contributor

@shanto shanto commented Jan 7, 2026

Unlike SQLite, MariaDB/MySQL returns dates as strings. This fix converts those strings back to Date objects.

Fixes: Domain name xxxxx will expire in NaN days #6618

Unlike SQLite, MariaDB/MySQL returns dates as strings. This fix converts those strings back to Date objects.

Fixes: Domain name xxxxx will expire in NaN days louislam#6618
@shanto shanto changed the title Parse date fields from DB as Date fix: Parse date fields from DB as Date (Domain Expiry) Jan 7, 2026
@louislam louislam added this to the 2.1.0 milestone Jan 8, 2026
@louislam louislam linked an issue Jan 8, 2026 that may be closed by this pull request
1 task
Copy link
Copy Markdown
Owner

@louislam louislam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That requires fixes/special handling inside RedBean codebase. Until then these fixes are all I can think of.

I think it is because of the assignment. MariaDB do not support well with the yyyy-mm-ddThh:mm:ss+Z format (I don't know the exact name of it)

We should use R.isoDateTimeMillis() to get the format which supported in both databases.

Incorrect assignment examples:

bean.lastCheck = new Date();

bean.expiry = expiryDate;

Correct Example:

bean.time = R.isoDateTimeMillis(dayjs.utc());

CommanderStorm and others added 4 commits January 9, 2026 02:30
+ Remove getDaysRemaining/getDaysBetween
# Conflicts:
#	.eslintrc.js
#	CONTRIBUTING.md
#	package-lock.json
#	package.json
#	server/util-server.js
#	src/pages/StatusPage.vue
#	test/backend-test/test-domain.js
@shanto
Copy link
Copy Markdown
Contributor Author

shanto commented Jan 9, 2026

We should use R.isoDateTimeMillis() to get the format which supported in both databases.

@louislam I have pushed the recommended changes along with some cleanups. Please review again.

@shanto shanto requested a review from louislam January 9, 2026 02:14
@shanto shanto changed the title fix: Parse date fields from DB as Date (Domain Expiry) fix: Proper processing of date fields (Domain Expiry) with cleanup of unnecessary Date comparison functions Jan 9, 2026
@CommanderStorm CommanderStorm merged commit a117add into louislam:master Jan 9, 2026
25 checks passed
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.

Domain name xxxxx will expire in NaN days

3 participants