Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
467 B
Text
17 lines
467 B
Text
import { toGregorian, toJalali } from "../_lib/jalali.js";
|
|
|
|
/**
|
|
*
|
|
* @param cleanDate {Date}
|
|
* @param args
|
|
* @returns {number}
|
|
*/
|
|
export function setMonth(cleanDate, ...args) {
|
|
const gd = cleanDate.getDate();
|
|
const gm = cleanDate.getMonth() + 1;
|
|
const gy = cleanDate.getFullYear();
|
|
const j = toJalali(gy, gm, gd);
|
|
const [month, date = j.jd] = args;
|
|
const g = toGregorian(j.jy, month + 1, date);
|
|
return cleanDate.setFullYear(g.gy, g.gm - 1, g.gd);
|
|
}
|