內容簡介
Future Dater 是一個簡單的外掛,可提供短代碼以在您的文章或頁面中包含特定類型的未來(或過去)日期。支援的日期類型包括「下一季開始」、「本季最後一天」、「下個月的第一天」等。
特色
[futuredate] 短代碼有 4 個參數:
unit – 必填。您想要修改的當前日期部分。有效值:「month」和「quarter」。
relunit – 可選。您想要引用單位的第一天或最後一天,還是與當前日期相同的那一天。有效值:「first」、「last」或無。
count – 必填。您要修改當前日期的數量,以 unit 參數所指定的單位為主。通常為 1(下個月或下一季)或 0(當前月份或季度)。也接受負值。
format – 可選。PHP 日期格式化字串,用於指定日期的打印方式。最常見的值為「Y-m-d」。
範例
本月底:[futuredate unit=month relunit=last count=0 format=”Y-m-d H:i:s”]
本季末:[futuredate unit=quarter relunit=last count=0 format=”Y-m-d”]
下一季的第一天:[futuredate unit=quarter relunit=first count=1 format=”Y-m-d”]
從現在開始,五個季度之後,季末:[futuredate unit=quarter relunit=last count=5 format=”Y-m-d”]
上一季末:[futuredate unit=quarter relunit=last count=-1 format=”Y-m-d”]
下個月的第一天:[futuredate unit=month relunit=first count=1 format=”Y-m-d”]
兩個月之後:[futuredate unit=month count=2 format=”Y-m-d”]
外掛標籤
開發者團隊
原文外掛簡介
Future Dater is a simple plugin to provide a shortcode to include certain types of future (or past) dates in your posts or pages. The type of dates supported are “beginning of next quarter”, “last day of this quarter”, “first day of next month”, etc.
Features
There are 4 arguments to the [futuredate] shortcode:
unit – Required. Which part of the current date you want to modify. Valid values: “month” and “quarter”.
relunit – Optional. Whether you want reference the first day or last day of the unit, or the same day as the current date. Valid values: “first”, “last”, or none.
count – Required. How much to modify the current date, in units specified by the unit argument. Most commonly 1 (for next month or next quarter) or 0 (for the current month or quarter). Also accepts negative values.
format – Optional. PHP date-formatting string to specify how the date should be printed. Most common value: `Y-m-d’.
Examples
The end of this month: [futuredate unit=month relunit=last count=0 format=”Y-m-d H:i:s”]
The end of this quarter: [futuredate unit=quarter relunit=last count=0 format=”Y-m-d”]
The first day of next quarter: [futuredate unit=quarter relunit=first count=1 format=”Y-m-d”]
The end of the quarter, 5 quarters from now: [futuredate unit=quarter relunit=last count=5 format=”Y-m-d”]
The end of previous quarter: [futuredate unit=quarter relunit=last count=-1 format=”Y-m-d”]
First day of next month: [futuredate unit=month relunit=first count=1 format=”Y-m-d”]
Two months from now: [futuredate unit=month count=2 format=”Y-m-d”]
