Problem with current date displaying in PM v27.2.0 (x64)

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
back0rifize

Problem with current date displaying in PM v27.2.0 (x64)

Unread post by back0rifize » 2017-03-22, 22:19

Good day's time!

After updating PM to version 27.2.0, I've got an issue with current date displaying: in Russia, we have DD.MM.YYYY format, but now it shows DD/MM/YYYY. It's not critical, but I would like to know the reason: maybe there was some changes in toLocaleDateString() method or it's a localization issue, or something else?

Thank you!
Attachments
How does it look now
How does it look now
Date.png (2.84 KiB) Viewed 1350 times

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by Moonchild » 2017-03-23, 10:32

The ICU library was updated which handles internationalization. It seems the separator character has been changed but without looking into it in more detail (and without knowing exactly the code creating the date you show here) it'll be difficult to find the reason.

Yes it's possible that toLocaleDateString() has changed and that the library update introduced a bug... but some more details are needed. Can you provide some steps to reproduce and find out what is done correctly and what is done wrong? Did you check your O.S./system settings as well for the correct separator being in use?
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

back0rifize

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by back0rifize » 2017-03-23, 12:47

I saw it in the status bar, where my addon (Calendate) places current date. Moreover, I've got this issue in its main window (when 'calendate.xul' is calling). For example, here is my code:

MAIN WINDOW WITH CURRENT DATE (CALLED FROM 'calendate.core.js')

Code: Select all

var actual = 
{
	date : function ()
	{
		var dpicker = document.getElementById('calenDate-main-datepicker').value;
		var tbox = document.getElementById('calenDate-current-date');
		var today = new Date();
		today.setTime(Date.parse(dpicker));
		tbox.setAttribute('value', today.toLocaleDateString());
	}
}
CURRENT DATE IN THE STATUS BAR PANEL (CALLED FROM 'button.core.js')

Code: Select all

var notify =
{
	me: function()
	{
		// Getting formatted date
		var bar = document.getElementById('calenDate-statusbarpanel-date');
		var button = document.getElementById('calenDate-button');
		var date = new Date();
		var month = ('0' + (date.getMonth() + 1)).slice(-2);
		var day = ('0' + date.getDate()).slice(-2);
		var set = date.getFullYear() + '-' + month + '-' + day;
		date.setTime(Date.parse(set));

		// Adding current date to statusbar panel
		bar.setAttribute('label',date.toLocaleDateString());
		bar.style.fontWeight = 'bold';

//...and so on...

	}
}
What about OS: I use Win7 x64 Enterprise (about 4 years). Nothing in my OS was changed since I updated my PM from v27.1.2 to 27.2.0. Today I did a rollback to PM v27.1.1 and all got right, the separators became again "dot" instead of "slash".

Hope this information helps both of us a little bit.

PS: Right now I was checking this code in a "Simple JS Editor" (or whatever it called in PM):

Code: Select all

var date = new Date();
var month = ('0' + (date.getMonth() + 1)).slice(-2);
var day = ('0' + date.getDate()).slice(-2);
var set = date.getFullYear() + '-' + month + '-' + day;
date.setTime(Date.parse(set));
alert(date.toLocaleDateString());
and I've got the"dot"- separators. Used version: 27.1.1.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by Moonchild » 2017-03-23, 15:05

Hmm yeah it looks like the ICU API has changed and it's not picking up the correct separators in our js engine.
Issue #976 created.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

JustOff

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by JustOff » 2017-04-02, 17:43

back0rifize wrote:It's not critical, but I would like to know the reason: maybe there was some changes in toLocaleDateString() method or it's a localization issue, or something else?
This regression was fixed in 27.3.0a1.

back0rifize

Re: Problem with current date displaying in PM v27.2.0 (x64)

Unread post by back0rifize » 2017-04-02, 20:17

Alrighty then! Отличненько!

Locked