From 97f2fd0fe18bf476304af06918de25059d4fd8b5 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 7 Mar 2025 21:16:44 -0500
Subject: fixes to daily journal creation.

---
 .../views/nodes/formattedText/DailyJournal.tsx     | 62 +---------------------
 1 file changed, 1 insertion(+), 61 deletions(-)

(limited to 'src/client/views/nodes/formattedText/DailyJournal.tsx')

diff --git a/src/client/views/nodes/formattedText/DailyJournal.tsx b/src/client/views/nodes/formattedText/DailyJournal.tsx
index dfd19ae97..51e9d9ec1 100644
--- a/src/client/views/nodes/formattedText/DailyJournal.tsx
+++ b/src/client/views/nodes/formattedText/DailyJournal.tsx
@@ -1,6 +1,5 @@
-import { action, makeObservable, observable } from 'mobx';
+import { makeObservable } from 'mobx';
 import * as React from 'react';
-import { RichTextField } from '../../../../fields/RichTextField';
 import { Docs } from '../../../documents/Documents';
 import { DocumentType } from '../../../documents/DocumentTypes';
 import { ViewBoxAnnotatableComponent } from '../../DocComponent';
@@ -8,8 +7,6 @@ import { FieldView, FieldViewProps } from '../FieldView';
 import { FormattedTextBox, FormattedTextBoxProps } from './FormattedTextBox';
 
 export class DailyJournal extends ViewBoxAnnotatableComponent<FieldViewProps>() {
-    @observable journalDate: string;
-
     public static LayoutString(fieldStr: string) {
         return FieldView.LayoutString(DailyJournal, fieldStr);
     }
@@ -17,63 +14,6 @@ export class DailyJournal extends ViewBoxAnnotatableComponent<FieldViewProps>()
     constructor(props: FormattedTextBoxProps) {
         super(props);
         makeObservable(this);
-        this.journalDate = this.getFormattedDate();
-
-        console.log('Constructor: Setting initial title and text...');
-        this.setDailyTitle();
-        this.setDailyText();
-    }
-
-    getFormattedDate(): string {
-        const date = new Date().toLocaleDateString(undefined, {
-            weekday: 'long',
-            year: 'numeric',
-            month: 'long',
-            day: 'numeric',
-        });
-        console.log('getFormattedDate():', date);
-        return date;
-    }
-
-    @action
-    setDailyTitle() {
-        console.log('setDailyTitle() called...');
-        console.log('Current title before update:', this.dataDoc.title);
-
-        if (!this.dataDoc.title || this.dataDoc.title !== this.journalDate) {
-            console.log('Updating title to:', this.journalDate);
-            this.dataDoc.title = this.journalDate;
-        }
-
-        console.log('New title after update:', this.dataDoc.title);
-    }
-
-    @action
-    setDailyText() {
-        const placeholderText = 'Start writing here...';
-        const dateText = `${this.journalDate}\n`;
-
-        console.log('Checking if dataDoc has text field...');
-
-        this.dataDoc[this.fieldKey] = RichTextField.textToRtfFormat(
-            [
-                { text: 'Journal Entry:', styles: { bold: true, color: 'black', fontSize: 20 } },
-                { text: dateText, styles: { italic: true, color: 'gray', fontSize: 15 } },
-                { text: placeholderText, styles: { fontSize: 14, color: 'gray' } },
-            ],
-            undefined,
-            placeholderText.length
-        );
-
-        console.log('Current text field:', this.dataDoc[this.fieldKey]);
-    }
-
-    componentDidMount(): void {
-        console.log('componentDidMount() triggered...');
-        // bcz: This should be moved into Docs.Create.DailyJournalDocument()
-        // otherwise, it will override all the text whenever the note is reloaded
-        this.setDailyTitle();
-        this.setDailyText();
     }
 
     render() {
-- 
cgit v1.2.3-70-g09d2

