Purana Jyotisha Sangraha · by Vyasa
Chapter 4 · Moon at Prabhasa, Mars at Kashi
शिवपुराणम् : कालज्ञानम् उत्पाताः ग्रहक्षेत्राणि च
वरं वृणीष्व भद्रं ते मनसा यत्समीप्सितम् ।प्रसन्नोऽहं शशिन्सर्वं दास्ये वरमनुत्तमम् ॥ ४२ ॥
From the Shiva Purana, print Kotirudra Samhita ch 14, verse 42.
"Choose a boon. May good come to you. Ask for whatever your heart wants. I am pleased, Moon. I will give you every best boon."
Simple meaning: The text says Shiva told the Moon to choose any boon.
यदि प्रसन्नो देवेश किमसाध्यं भवेन्मम ।
The text says the Moon asked Shiva to stop the wasting of his body.
क्षंतव्यो मेऽपराधश्च कल्याणं कुरु सर्वदा ।
The text says the Moon asked for forgiveness and Shiva answered.
पक्षे च क्षीयतां चन्द्र कला ते च दिने दिने ।
The text says Shiva told the Moon to wane in one fortnight and grow in the other.