MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
Nightingale Forums - Smart playlist using Last Played date

Nightingale Forums

Full Version: Smart playlist using Last Played date
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I recently migrated from Songbird to Nightingale.

I wanted to make a smart playlist, which was fairly simplistic, but the date value keeps changing on me, every time I change focus off the field.

I do live in Australia, where the date format is reversed of the US, so, that may be causing it...

To reproduce:
File > New Smart Playlist
Change Artist to Last Played.
The criteria defaults to "is", and today's date, which for me is 18/05/2015
Click the + to add more conditions.
Click back in the date field, of the first condition
Click back in the new empty field, of the second condition
The date value is changed from 18/05/2015 to 5/06/2016
Click back in the date field, of the first condition
Click back in the new empty field, of the second condition
The date value is changed from 5/06/2016 to 6/05/2016
Click back in the date field, of the first condition
Click back in the new empty field, of the second condition
The date value is changed from 6/05/2016 to 5/06/2016

Repeat infinitely.

Can anyone else reproduce this?
(05-18-2015, 02:28 PM)pandpp Wrote: [ -> ]Can anyone else reproduce this?

Yes and no... I can reproduce the initial change, but not the changes afterwards. In Germany, we use "day.month.year", and Nightingale accepts input in both the local (Geman) and US-format ("month/day/year").

Entering the String "18/05/2015" causes it to be switched to "05.06.2016" (which indeed sounds stupid, but somewhat correct as the 18. month is the 6. month in the next year). The string is thus treated as (slightly malformed^^) US-format.

I'd assume that the UI code first checks for US-formatted dates (the check succeeds), then converts the time to your local format (switching month and day). Validation is likely triggered on each focus change away from the edit form.


Man, why are there so many date formats around...

Edit: if someone wants to have a look at the technical side of this, sbDatetimePropertyInfo holds default output formatting (which seems to work for me; called from here), but the inverse operation is not handled in the property but using Date.parse, which seems to have the issues we see here.

@pandpp: Please open the error console (Tools|Error console...) and enter the following code in the "Code:" field
Code:
new Date(Date.parse("18/05/2015"))
A result should pop up at the end of the console; for example "Sun Jun 05 2016 00:00:00 GMT+0200 (CET)" (German Nightingale in GMT+2). What do you get?
(05-21-2015, 05:13 AM)rsjtdrjgfuzkfg Wrote: [ -> ]@pandpp: Please open the error console (Tools|Error console...) and enter the following code in the "Code:" field



Code:
new Date(Date.parse("18/05/2015"))
A result should pop up at the end of the console; for example "Sun Jun 05 2016 00:00:00 GMT+0200 (CET)" (German Nightingale in GMT+2). What do you get?

When I evaluate:
Code:
new Date(Date.parse("18/05/2015"))

in the error console, the result I get is:
Sun Jun 05 2016 00:00:00 GMT+1000 (AEST)

Taking that one step further, when I evaluate:
Code:
new Date(Date.parse("05/06/2016"))

in the error console, the result I get is:
Fri May 06 2016 00:00:00 GMT+1000 (AEST)

And of course, if I evaluate:
Code:
new Date(Date.parse("06/05/2016"))

in the error console, the result I get is:
Fri Jun 05 2016 00:00:00 GMT+1000 (AEST)

This is what gives me the infinitely repeatable step.
Thanks for reproducing the issue!

Issue #350 opened.