1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Miglioramento organizzazione JS

This commit is contained in:
Thomas Zilio
2019-07-26 17:40:52 +02:00
parent 4d6b15a217
commit dea2d1dbdc
55 changed files with 1805 additions and 1994 deletions

View File

@ -31,36 +31,7 @@ function add_calendar() {
<br>
</div>`);
// Calendario principale
ranges = {};
ranges[globals.translations.today] = [moment(), moment()];
ranges[globals.translations.firstThreemester] = [moment("01", "MM"), moment("03", "MM").endOf('month')];
ranges[globals.translations.secondThreemester] = [moment("04", "MM"), moment("06", "MM").endOf('month')];
ranges[globals.translations.thirdThreemester] = [moment("07", "MM"), moment("09", "MM").endOf('month')];
ranges[globals.translations.fourthThreemester] = [moment("10", "MM"), moment("12", "MM").endOf('month')];
ranges[globals.translations.firstSemester] = [moment("01", "MM"), moment("06", "MM").endOf('month')];
ranges[globals.translations.secondSemester] = [moment("06", "MM"), moment("12", "MM").endOf('month')];
ranges[globals.translations.thisMonth] = [moment().startOf('month'), moment().endOf('month')];
ranges[globals.translations.lastMonth] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')];
ranges[globals.translations.thisYear] = [moment().startOf('year'), moment().endOf('year')];
ranges[globals.translations.lastYear] = [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')];
$("#" + name).daterangepicker({
locale: {
customRangeLabel: globals.translations.custom,
applyLabel: globals.translations.apply,
cancelLabel: globals.translations.cancel,
fromLabel: globals.translations.from,
toLabel: globals.translations.to,
},
startDate: globals.start_date_formatted,
endDate: globals.end_date_formatted,
applyClass: "btn btn-success btn-sm",
cancelClass: "btn btn-danger btn-sm",
ranges: ranges,
linkedCalendars: false
}, function (start, end) {
start_complete_calendar("#" + name, function (start, end) {
var name = $(this.element).attr("id");
var start = start.format("YYYY-MM-DD");
var end = end.format("YYYY-MM-DD");