BodyMindLife Timetable Fixer

Improves BodyMindLife.com class timetable to include weekday

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         BodyMindLife Timetable Fixer
// @namespace    http://tampermonkey.net/
// @version      0.2
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @description  Improves BodyMindLife.com class timetable to include weekday
// @author       pelmeshkin
// @include      https://www.bodymindlife.com/*
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var weekdays = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];

    $('section.banner').hide();
    $('#sitewide-notification').hide();
    $('.timetable-section .timetable-header-container').find('.col:eq(2)').each(function(index, value){
        var date = $(value).text();
        var day = date.split('/')[0];
        if(day < 10) { day = '0' + day; }
        var month = date.split('/')[1];
        var year = (new Date()).getFullYear();
        var yyyymmdd = new Date(year + '-' + month + '-' + day);
        var weekday = weekdays[yyyymmdd.getDay()];
        $(value).css('width', '7.6%').text(weekday + ' ' + day + '/' + month);
    });
})();