#! ngraph
# Description: _Calendar,show calendar in the information window,

new regexp
regexp::@="(?i)UTF-?8"

if regexp::match "$LANG"
then
    LOCALE=$LANG
else
    LOCALE=C
fi

del regexp

DATE=`date +%m`

set +e
new dialog
dialog::title="Calendar"
dialog::caption="select MONTH"
DATE=`get dialog: -field integer_entry:"1 12 1 $DATE"`
RVAL=$?
del dialog
set -e

if [ $RVAL != 0 ]
then
    exit
fi

YEAR=`date +%Y`
MONTH=`iexpr $DATE`

menu::echo
LANG=$LOCALE /usr/bin/ncal -3Mbh $MONTH $YEAR | menu::cat
menu::echo
