Auto Update Website Footer Date with JavaScript

The Problem: Every year the footer of your personal or company website will need to be updated. It would be a waste of your time and you would risk breaking your code if you needed to update every single webpage to type “2020” in the footer of the page. This should be automated.

The Solution: Use JavaScript to get the date, set it as a variable, and display the result in the footer of the page.

<script type="text/javascript"> //Declares the JavaScript
   
   let d = new Date(); // Creates a variable and calls Date Object
   
   document.write(d.getFullYear()); // Calls getFullYear method on variable d(new Date() Object) and displays year

</script> // Closing bracket

The code above can be copied and pasted into the footer of your website pages. If you have a couple of static pages, it isn’t a big deal to edit each page. In my case, I added the code to the footer.php file for my custom WordPress theme. WordPress automatically appends the footer.php to every new post or page that I create. Now a user will always see a dynamically generated date at the bottom of the page.

Food Inventory

The Problem: Opening and digging through a smaller chest freezer. Also, need a way to keep track of food inventory for quarantine.
The Solution: A database accessible from my phone to add, remove, update, or delete items. At the grocery I can see what I have or don’t have at home.

Total Records Found: 93, showing 20 per page
CountItemBrandOuncesCategoryLocationUpdated
1 Top Round London Broil Giant 34 Meat Downstairs Freezer November 29, 2020
1 Salmon Atlantic Natures Promise 16 Fish Downstairs Freezer November 29, 2020
2 Pork Tenderloin Garlic Parmesan Hatfield 18 Meat Downstairs Freezer November 29, 2020
1 Chicken Nuggets Dino Tyson 29 Meat Downstairs Freezer November 29, 2020
1 Chicken Nuggets Dino Purdue 27 Meat Downstairs Freezer November 29, 2020
1 Spinach Littles Dr. Praegers 10 Vegetable Downstairs Freezer November 29, 2020
1 Sausage Pork Breakfast Applegate 7 Meat Downstairs Freezer November 29, 2020
1 Sausage Chicken Maple Breakfast Applegate 7 Meat Downstairs Freezer November 29, 2020
1 English Muffin Banana Bread Thomas 12 Bread Downstairs Freezer November 29, 2020
1 Turkey Breast Giant 16 Meat Downstairs Freezer November 29, 2020
2 Steak New York Strip Giant 10 Meat Downstairs Freezer November 29, 2020
1 Breaded Fishies Dr. Praegers 10 Fish Downstairs Freezer November 29, 2020
1 Shrimp Raw Generic 32 Fish Downstairs Freezer November 29, 2020
1 Bacon Hickory Thick Hatfield 16 Meat Downstairs Freezer November 29, 2020
1 Fudgsicle Fudgsicle 16 Snack Upstairs Freezer November 29, 2020
2 Chicken Broccoli Cheese Barber Foods 5 Meat Downstairs Freezer November 29, 2020
1 Meatballs Angus Cooked Perfect 20 Meat Downstairs Freezer November 29, 2020
2 Pizza Thin Crust Giant 18 Other Downstairs Freezer November 29, 2020
2 Chicken Nuggets Tyson 32 Meat Downstairs Freezer November 29, 2020
1 Broccoli Tots Birds Eye 12 Vegetable Downstairs Freezer November 29, 2020

OUT OF STOCK:

Total Records Found: 30, showing 20 per page
CountItemBrandOuncesCategoryLocationUpdated
0 Chicken Brie Apple Barber Foods 5 Meat Downstairs Freezer December 1, 2020
0 Spinach Generic 16 Vegetable Downstairs Freezer December 1, 2020
0 Key Lime Pie Edwards 5 Snack Downstairs Freezer November 29, 2020
0 Chicken Breast Generic 20 Meat Downstairs Freezer November 29, 2020
0 Chuck Roast Giant 37 Meat Downstairs Freezer November 29, 2020
0 Bacon Hickory Generic 16 Meat Downstairs Freezer November 5, 2020
0 Brussel Sprouts Green Giant 10 Vegetable Downstairs Freezer November 5, 2020
0 Pork Loin Fillet Adaptable Meats 32 Meat Downstairs Freezer November 5, 2020
0 French Fries Straight Cut Ore Ida 32 Vegetable Downstairs Freezer October 10, 2020
0 Pizza Pepperoni Digiorno 0 Other Downstairs Freezer October 10, 2020
0 Pizza Three Cheese Red Baron 18 Other Downstairs Freezer October 10, 2020
0 Burger Chophouse 4 Meat Upstairs Freezer September 22, 2020
0 Burger Angus Miami Beef 5 Meat Downstairs Freezer September 22, 2020
0 Corn Green Giant 10 Vegetable Downstairs Freezer September 15, 2020
0 Carrots Green Giant 10 Vegetable Downstairs Freezer September 15, 2020
0 Meatballs Angus Cooked Perfect 20 Meat Upstairs Freezer September 6, 2020
0 English Muffins Honey Wheat Thomas 12 Bread Downstairs Freezer September 4, 2020
0 Ice Cream Mint Chocolate Chip Turkey Hill 48 Snack Upstairs Freezer September 4, 2020
0 Italian Bread Maiers 20 Bread Downstairs Freezer September 4, 2020
0 Ice Cream Mint Chocolate Chip Greens 48 Snack Downstairs Freezer August 26, 2020


I customized the WordPress plugin “Participants Database” to Create, Read, Update, and Delete food items. Anyone can add items but a WordPress login is required to update or delete food items.