How to move Date and Time from the notication pannel to the bottom instead of top

Hi everyone i am new here

that some one to reddit helped to solve a problem using a extension but it is in a raw code.

How do you get it to work on Zoris os 17

/**
 * GNOEM Extension to move the date and calendar
 * to the end of calendar column
 *
 * @author     Javad Rahmatzadeh
 * @copyright  2024
 * @license    GPL-3.0-only
 */

import * as Main from 'resource:///org/gnome/shell/ui/main.js';

import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';

export default class CalendarPositionExtension extends Extension
{
    #dateMenu = Main.panel.statusArea.dateMenu;
    #calendar = this.#dateMenu._calendar;
    #date = this.#dateMenu._date;

	enable() {
	    const calendarColumn = this.#getCalendarColumn();
	    
	    if (calendarColumn) {
                calendarColumn.remove_child(this.#date);
                calendarColumn.remove_child(this.#calendar);
                calendarColumn.insert_child_at_index(this.#date, 3);
                calendarColumn.insert_child_at_index(this.#calendar, 4);
            }
	}

	disable() {
	    const calendarColumn = this.#getCalendarColumn();
	    
	    if (calendarColumn) {
                calendarColumn.remove_child(this.#date);
                calendarColumn.remove_child(this.#calendar);
                calendarColumn.insert_child_at_index(this.#date, 0);
                calendarColumn.insert_child_at_index(this.#calendar, 1);
            }
	}
	
	#getCalendarColumn() {
	    return this.#dateMenu.menu.box.get_first_child()?.get_first_child()?.get_child_at_index(1);
	}
}

Here is the reddit
https://www.reddit.com/r/gnome/comments/1f8qn0t/how_to_move_date_and_time_from_the_notication/

Ok got it kind to work but i dont know what went wrong though

This is what i did for the metadata.json

for the extension.js i didnt change a word


Comment Image


Comment Image

That there is an error: import declarations may only appear at top level of a module

i dont no idea

OK problem solve this is the verison that will owrk or zoris 17

[

const Main = imports.ui.main;

const dateMenu = Main.panel.statusArea.dateMenu;
const calendar = dateMenu._calendar;
const date = dateMenu._date;

function _getCalendarColumn() {
    return dateMenu.menu.box.get_first_child().get_first_child().get_child_at_index(1);
}

function enable() {
    const calendarColumn = _getCalendarColumn();
    
    if (calendarColumn) {
        calendarColumn.remove_child(date);
        calendarColumn.remove_child(calendar);
        calendarColumn.insert_child_at_index(date, 3);
        calendarColumn.insert_child_at_index(calendar, 4);
    }
}

function disable() {
    const calendarColumn = _getCalendarColumn();
    
    if (calendarColumn) {
        calendarColumn.remove_child(date);
        calendarColumn.remove_child(calendar);
        calendarColumn.insert_child_at_index(date, 0);
        calendarColumn.insert_child_at_index(calendar, 1);
    }
}

]

image

this is the metadata.json

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.