====== How To: Tasker - Add an Ordinal-Type date with a Total Launcher Text Variable ====== Standard date formatting in Total Launcher displays the day as a simple integer (e.g., "1", "21"). A specific configuration is required to display an ordinal format (e.g., "1st", "2nd", "21st"). Because Total Launcher does not allow mixing date codes (like ''d'') and custom variables (like '''') in a single text field, a **Modular Composite Approach** is utilized: * **Tasker** generates the "Ordinal Day" unit (e.g., "21st"). * **Total Launcher** handles the **Month**, **Year**, and **Day of Week** natively. * The separate objects are arranged on the screen to form the desired date format. ===== Section 1. Configuring the Tasker Task ===== This task calculates the day number, determines the correct suffix (st, nd, rd, th), and sends the combined string to Total Launcher. - Create a new Task in Tasker named "Date Ordinal" (to produce ''day_ord''). - **Action 1: Extract Day Number** - Add the action **Parse/Format DateTime**. - Set **Input Type** to ''Now''. - Set **Output Format** to ''d''. - **Output Variable:** Set to ''%day_num''. - //This isolates the day (e.g., "21") for calculation.// - **Action 2: Calculate Suffix (Run Shell)** - Add the action **Run Shell**. - In the **Command** field, enter this code (( function ordinal () { case "$1" in *1[0-9] | *[04-9]) echo "$1"th;; *1) echo "$1"st;; *2) echo "$1"nd;; *3) echo "$1"rd;; esac } echo "$(ordinal %day_num)" )) - Set **Store Output In** to ''%day_ord''. - //This script takes the input "21" and outputs "21st".// - **Action 3: Send to Total Launcher** - Add the action **Plugin** > **Total Launcher** > **Send variable**. - Set **Configuration** to send ''%day_ord'' to the Total Launcher variable name ''day_ord''. ===== Section 2. Configuring the Tasker Schedule (Profile) ===== To ensure the date updates automatically, a Tasker Profile is required to trigger the task at the start of every day. - Navigate to the **Profiles** tab in Tasker. - Select **Add** (+) - A TaskerNet dialog open - Select **Create** - A new Profiles dialog opens. Select **Time**. - Set **From:** to ''00:01'' (12:01 AM). - **Every** - This option is to be left in it's default state (**unchecked** and left **blank**) - Set **To:** to ''00:01'' (or leave blank depending on Tasker version). - Tap **Back** (←) to save the time context. - A new dialog opens listing all tasks. Scroll and select the **Date Ordinal** task (created in Section 1). - **Result:** Tasker will now run the "Date Ordinal" task at 12:01am and push the new ordinal date to Total Launcher essentially immediately after midnight every day. ===== Section 3. Configure Total Launcher Setup with Layout Flexibility ===== With the Tasker Ordinal Date variable established, separate text objects need to be created for each Total Launcher date component. This allows for precise control over the desired layout. ==== Step 1: Display the Ordinal Day from Tasker ==== This object will display the variable generated by Tasker. - Enter **Edit Mode** (long-press an empty area). - Select **Add** (+) > **Graphic** > **Text**. - Open the **Options** menu (Gear icon) for the new text object. - In the Edit dialog select **Text**. - In the Text dialog scroll down to **Advanced - Variable** - In the input field, enter the variable tag: ''''. - Tap OK and back out of the screen to the page - The object will now display the ordinal date (e.g., "21st"). - If Section 1 (Configuring the Tasker Task) has //not// been run, the variable ''day_ord'' has no value and will display it's text//literally//. - If the Tasker action or event has been run, the Total Launcher should show the day's actual date in ordinal format (in this narrative the 21st is used) ==== Step 2: Create and Display TL's Native Components (Month/Year/Day) ==== These objects use Total Launcher's built-in date engine. Repeat this process for each component needed (e.g., one object for Month, one for Year, one for Day of Week). - Enter **Edit Mode** > **Add** (+) > **Graphic** > **Text**. - The "Text" object is placed on the page and is selected - In the Objected Design menu tap the **Option** icon > **Text** > **Advanced - Variable** elements. - Select **Date/Time**. - The input dialog typically defaults to MMMM d, yyyy (in this narrative would result in August 21st, 2025) - **Change the Default to the Desired Format:** - At the end of the input dialog is an Option icon {{:ui:ui-icon_option.webp?direct&25}}. Tap it. - Time Zone: provides for global time zone selection - Use English: - Format: Displays formatting for month-date-year and day of week styles - If none of these styles are desired (an the purpose of this procedure is allow **customization**), the user may wish to learn more technical detail by tapping the [[https://developer.android.com/reference/java/text/SimpleDateFormat|(?) icon]] but below is the TL>DR explanation for this procedure. In this dialog just tap **Cancel** and proceed to the following sub-step: - After cancelling, the Text dialog shows the input formatting line. Enter one of the following formats for the desired **single** object: - - **Standard Codes:** - ''MMMM'' = Full Month (August) - ''MMM'' = Short Month (Aug) - ''yyyy'' = Year (2025) - ''EEEE'' = Day of Week (Thursday) - ''EEE'' = Short Day (Thu) - When properly set, press OK and back out of the dialog to the page with the text object selected. - Repeat this Section3 Step 2 in it's entirety for each descriptive date object desired. ==== Step 3: Mix the Objects in the Date Layout ==== The separate objects are dragged into the desired visual order and location on the page. * **Full Header Format:** - Layout Order: [Day of Week] , [Month] [Ordinal Day] , [Year] - Visual Result: **Thursday, August 21st, 2025** * **International Format:** - Layout Order: [Day of Week] [Ordinal Day] [Month] [Year] - Visual Result: **Thursday 21st August 2025** * **Stacked/Widget Style:** - The [Day of Week] is placed in a large font at the top. - The [Month] and [Ordinal Day] are placed below in a smaller font. * **Be Creative** - "Imagine It! Make It!" ===== Section 4. Final Alignment of the Text Objects ===== - After preliminarily arranging the objects, select all the text objects. - Use the Object Design menu's **Align** tools {{:ui:ui-icon_align.webp?direct&25}} (specifically **Vertical "|"** and **Horizontal "_"**) to ensure the text sits on the same baseline or centered, or right/left boundary. - Then, with all the text objects selected, tap the **Group** tool {{:ui:ui-icon_group.webp?direct&25}} to combine them into a single widget for easy movement and final placement. Procedure Complete! {{page>site:site-footer-comment_feedback_block}}