mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00

Image import is now triggering a popup after selecting the file. Same for local saves. Drag and drop of .piskel files opens the piskel immediately ! Remains to do : - redesign the dialog for import image and browse local - create dialog for recover session - improve recover session to handle more than the last session
25 lines
547 B
JavaScript
25 lines
547 B
JavaScript
(function () {
|
|
var ns = $.namespace('pskl.utils');
|
|
|
|
var pad = function (num) {
|
|
if (num < 10) {
|
|
return "0" + num;
|
|
} else {
|
|
return "" + num;
|
|
}
|
|
};
|
|
|
|
ns.DateUtils = {
|
|
format : function (date, format) {
|
|
date = new Date(date);
|
|
return pskl.utils.Template.replace(format, {
|
|
Y : date.getFullYear(),
|
|
M : pad(date.getMonth() + 1),
|
|
D : pad(date.getDate()),
|
|
H : pad(date.getHours()),
|
|
m : pad(date.getMinutes()),
|
|
s : pad(date.getSeconds())
|
|
});
|
|
}
|
|
};
|
|
})(); |